1/25
These flashcards cover fundamental concepts of algorithms, searching and sorting algorithms, programming principles, and exam preparation strategies.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
What is an algorithm?
A sequence of steps that can be followed to complete a task.
Define decomposition in problem-solving.
Decomposition is breaking a problem into sub-problems that accomplish identifiable tasks.
What is abstraction?
Abstraction is the process of removing unnecessary detail from a problem.
What is pseudo-code?
A way to represent algorithms in a structured format using plain language and programming conventions.
What should students be able to identify in simple algorithms?
Inputs, processing, and outputs.
What are searching algorithms used for?
To locate data within a data set.
How does the linear search algorithm work?
It checks each element in a list sequentially until the target is found or the list ends.
What is a binary search algorithm?
An algorithm that finds the position of a target value by repeatedly dividing the search interval in half.
What are advantages of binary search over linear search?
Binary search is more efficient with sorted data sets, requiring fewer comparisons.
What are sorting algorithms used for?
To arrange the elements of a data set in a specified order.
How does the merge sort algorithm work?
It divides the data in half, sorts each half, and then merges the sorted halves.
What is the bubble sort algorithm?
A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
Compare merge sort and bubble sort.
Merge sort is more efficient for large lists than bubble sort, which is much slower.
What is a meaningful identifier name in programming?
A name used for variables or functions that clearly describes what they represent.
What is the significance of data types in programming?
Data types determine the kind of data a variable can hold and operations that can be performed on it.
What is the role of pseudo-code in exams?
To represent solutions to algorithmic problems in an understandable way.
How does a pseudo-code response format differ from actual code?
Pseudo-code is simpler and does not require strict syntax rules.
How is problem-solving approached in algorithm creation?
Using a systematic approach that includes representation methods like pseudo-code and flowcharts.
What is the main purpose of a linear search algorithm?
To find a specific element within an unsorted list.
What are the disadvantages of a linear search?
It can be slow, especially with large data sets.
What is required for a binary search to function?
The data set must be sorted beforehand.
How are flowcharts utilized in algorithm representation?
They visually represent the flow of control and data in an algorithm.
What is a comparison of linear search and binary search in terms of efficiency?
Binary search is more efficient than linear search due to fewer comparisons in sorted data.
Explain how merge sort is more effective than bubble sort.
Merge sort has better performance by reducing the number of comparisons needed to sort.
What impact does using meaningful identifiers have in programming?
It enhances code readability and maintainability.
Why is systematic problem-solving important in computing?
It enables clear and logical steps to be followed to arrive at a solution.