What this deck covers
This deck focuses on Algorithmic Efficiency, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Study Algorithmic Efficiency in AP Computer Science Principles with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Identify the Big O notation for insertion sort in the best case.
Tap card or press Space to flip
O(n). Already sorted array requires only single pass.
How well did you know it?
Card 1 / 78
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Algorithmic Efficiency, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: O(n). Already sorted array requires only single pass.
Answer: O(n3). Three nested loops for standard multiplication algorithm.
Answer: O(n log n). Maintains heap property through logarithmic operations.
Answer: O(VE). Relaxes edges multiple times across all vertices.
Answer: O(1). Operation takes same time regardless of input size.
Answer: Algorithmic efficiency measures resource usage. Focuses on time and space usage as performance metrics.
Answer: It describes the upper limit of an algorithm's complexity. Represents worst-case performance as input size grows.
Answer: O(n). Must examine every element without ordering advantage.
Answer: O(E log E). Sorting edges dominates the union-find operations.
Answer: O(n2). Compares adjacent pairs through nested iterations.
Answer: O(n2). Poor pivot selection leads to unbalanced partitions.
Answer: O(n2). Nested loops to find minimum and swap elements.
Answer: O(n3). Three nested loops for standard multiplication algorithm.
Answer: O(E log E). Sorting edges dominates the union-find operations.
Answer: O(n2). Nested loops create quadratic growth pattern.
Answer: O(log n). Eliminates half of remaining elements each iteration.
Answer: O(log n). Eliminates half of remaining elements each iteration.
Answer: O(2n). Runtime doubles with each additional input element.
Answer: Correct: 'A binary search has O(log n) complexity.'. Binary search divides search space logarithmically.
Answer: O(V+E). Visits each vertex and edge exactly once.
Answer: O(nm), where n is text length and m is pattern length. Compares pattern at every possible text position.
Answer: Correct: 'The time complexity of merge sort is O(n log n).'. Merge sort consistently divides and merges efficiently.
Answer: It measures the memory usage of an algorithm. Tracks additional storage beyond input data.
Answer: O(V). Queue size bounded by number of vertices.
Answer: O(V). Recursion stack depth limited by vertex count.
Answer: O(log n). Search space halves with each comparison step.
Answer: O(nm), where n is text length and m is pattern length. Compares pattern at every possible text position.
Answer: O(1). Direct access through hash function calculation.
Answer: O(n log n). Balanced partitioning creates optimal divide-and-conquer.
Answer: O(n). Must examine every element without ordering advantage.
Answer: O(V2). Uses adjacency matrix for dense graph representation.
Answer: O(n log n). Good pivot creates balanced recursive partitions.
Answer: It measures the memory usage of an algorithm. Tracks additional storage beyond input data.
Answer: O(n log n). Maintains heap property through logarithmic operations.
Answer: O(1). Operation takes same time regardless of input size.
Answer: It describes the upper limit of an algorithm's complexity. Represents worst-case performance as input size grows.
Answer: O(n log n). Divide-and-conquer with linear merge operations.
Answer: Linear search algorithm. Checks each element once in worst case.
Answer: O(2n). Each call branches into two recursive calls.
Answer: O(2n). Each call branches into two recursive calls.
Answer: O(n2). Nested loops create quadratic growth pattern.
Answer: O(n2). Comparisons increase quadratically for reverse-sorted input.
Answer: O(n). Already sorted array requires only single pass.
Answer: It means time complexity is O(nk) for constant k. Runtime bounded by polynomial function of input size.
Answer: O(n3). All-pairs shortest path with triple nested loops.
Answer: O(V+E). Explores all vertices and their adjacent edges.
Answer: O(n2). Adjacent swaps still require quadratic comparisons.
Answer: Correct: 'The time complexity of merge sort is O(n log n).'. Merge sort consistently divides and merges efficiently.
Answer: O(n). Examines each element sequentially until found.
Answer: O(n log n). Balanced partitioning creates optimal divide-and-conquer.
Answer: O(n2). Nested loops to find minimum and swap elements.
Answer: O(V). Recursion stack depth limited by vertex count.
Answer: O(1). Direct access through hash function calculation.
Answer: O(n2). Adjacent swaps still require quadratic comparisons.
Answer: O(V+E). Explores all vertices and their adjacent edges.
Answer: It means time complexity is O(nk) for constant k. Runtime bounded by polynomial function of input size.
Answer: Correct: 'A binary search has O(log n) complexity.'. Binary search divides search space logarithmically.
Answer: O(E log V). Priority queue operations dominate edge processing time.
Answer: Algorithmic efficiency measures resource usage. Focuses on time and space usage as performance metrics.
Answer: Linear search algorithm. Checks each element once in worst case.
Answer: O(E log V). Priority queue operations dominate edge processing time.
Answer: O(n2). Comparisons increase quadratically for reverse-sorted input.
Answer: Correct: 'BFS has a space complexity of O(V).'. Queue stores vertices, not edges during traversal.
Answer: O(log n). Search space halves with each comparison step.
Answer: O(n log n). Divide-and-conquer with linear merge operations.
Answer: O(VE). Relaxes edges multiple times across all vertices.
Answer: O(n). Examines each element sequentially until found.
Answer: O(n log n). Good pivot creates balanced recursive partitions.
Answer: O(V). Queue size bounded by number of vertices.
Answer: O(n). Call stack grows proportionally with recursion depth.
Answer: O(n2). Poor pivot selection leads to unbalanced partitions.
Answer: O(V2). Uses adjacency matrix for dense graph representation.
Answer: O(n3). All-pairs shortest path with triple nested loops.
Answer: O(n2). Compares adjacent pairs through nested iterations.
Answer: Correct: 'BFS has a space complexity of O(V).'. Queue stores vertices, not edges during traversal.
Answer: O(V+E). Visits each vertex and edge exactly once.
Answer: O(n). Call stack grows proportionally with recursion depth.
Answer: O(2n). Runtime doubles with each additional input element.