Flashcards · Algorithms · Free
Algorithms flashcards, generated for you.
Example Algorithms study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Algorithms flashcards
What is an algorithm?
A step-by-step procedure to solve a problem or compute a result, with a defined input and output.
What does time complexity measure?
The number of basic operations an algorithm performs relative to input size n, expressed using Big O notation.
What does space complexity measure?
The amount of additional memory an algorithm uses relative to input size n, excluding input storage.
Why is Big O analysis preferred over exact operation counts?
Big O abstracts away constants and lower-order terms, revealing how runtime scales as input grows, making algorithms comparable across machines.
What is the trade-off between time and space complexity?
Algorithms often optimize for speed by using extra memory (caching, memoization) or minimize memory at the cost of repeated computation.
What makes an algorithm greedy, and when does it work?
A greedy algorithm makes locally optimal choices at each step. It works only when the problem has optimal substructure and the greedy choice property (local optimality leads to global optimality).
How does divide-and-conquer differ from dynamic programming?
Divide-and-conquer breaks problems into independent subproblems (no overlap); dynamic programming optimizes overlapping subproblems via memoization or tabulation.
What is the difference between stable and unstable sorting algorithms?
Stable sort preserves the relative order of equal elements; unstable does not. Stability matters when sorting by multiple keys or maintaining original ordering context.
Why choose merge sort over quicksort or vice versa?
Merge sort: O(n log n) worst-case, stable, requires O(n) extra space. Quicksort: O(n log n) average, O(n²) worst-case, in-place, faster in practice. Choose based on whether you need guaranteed time or space efficiency.
What is NP-completeness and why does it matter in practice?
NP-complete problems have no known polynomial-time solution; if one is found, all are solvable in polynomial time. For large instances, use approximation, heuristics, or constraint-based solutions rather than exhaustive search.
Make your own Algorithms study set
Flashcards for related topics
Studying Algorithms to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →