All Flashcards
Define algorithm.
A set of steps to accomplish a task.
What does 'efficiency' mean in the context of algorithms?
A measure of how well an algorithm uses resources (time, memory).
Define 'debugging'.
The process of finding and fixing errors in code.
What is data compression?
Reducing the size of data for efficient storage or transmission.
What is 'academic integrity'?
Honesty and responsibility in scholarly work; includes citing sources.
Define 'trade-off' in algorithm selection.
Balancing different factors like speed, memory usage, and complexity when choosing an algorithm.
What is a 'sorting algorithm'?
An algorithm that arranges items in a specific order (e.g., numerical, alphabetical).
Define 'route-finding algorithm'.
An algorithm that determines the best path between two points.
What is 'algorithm design'?
The process of creating and planning an algorithm to solve a specific problem.
What is a 'minimum value algorithm'?
An algorithm that finds the smallest value in a set of data.
Compare creating a new algorithm vs. using an existing one.
New: More work, potentially tailored | Existing: Faster, less debugging, may not perfectly fit.
Compare Bubble Sort and Selection Sort.
Bubble Sort: Repeatedly compares adjacent elements | Selection Sort: Finds the minimum element and swaps it.
Compare the advantages of different sorting algorithms.
Some are faster for nearly sorted data, others have better average-case performance.
Compare the disadvantages of different sorting algorithms.
Some have poor worst-case performance, others require significant memory overhead.
Compare the efficiency of different search algorithms.
Linear search is simple but slow; binary search is faster but requires sorted data.
Compare iterative and recursive algorithms.
Iterative: Uses loops | Recursive: Calls itself; can be more elegant but may have overhead.
Compare the use of arrays and linked lists for storing data.
Arrays: Fixed size, fast access | Linked Lists: Dynamic size, slower access.
Compare the best-case and worst-case scenarios for an algorithm.
Best-case: Most efficient execution | Worst-case: Least efficient execution.
Compare the time complexity and space complexity of an algorithm.
Time complexity: How execution time grows with input size | Space complexity: How memory usage grows with input size.
Compare the use of divide-and-conquer algorithms vs. dynamic programming.
Divide-and-conquer: Breaks problem into independent subproblems | Dynamic programming: Solves overlapping subproblems only once.
Why are there often multiple algorithms for the same problem?
Different algorithms have different trade-offs (efficiency, complexity) and suit different program needs.
Why is it useful to leverage existing algorithms?
Reduces development time, simplifies debugging, and provides reliable solutions.
How can new algorithms be created?
From scratch or by combining and modifying existing algorithms.
What factors influence the choice of an algorithm?
Efficiency, program requirements, programmer experience, and data characteristics.
Why is algorithm design a core concept in computer science?
It's fundamental to problem-solving and creating efficient, effective software.
What is the importance of citing sources when using existing algorithms?
To give credit to the original creator and maintain academic integrity.
Explain the concept of 'algorithmic thinking'.
A way of approaching problems by breaking them down into a series of logical steps.
What does it mean for an algorithm to be 'scalable'?
The algorithm can efficiently handle increasing amounts of data or users.
How does the choice of data structure affect algorithm design?
The data structure can significantly impact an algorithm's efficiency and complexity.
What is the role of abstraction in algorithm design?
Abstraction allows us to focus on the essential aspects of an algorithm without getting bogged down in details.