Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Algorithmic ThinkingEasy
Q1. What is algorithmic thinking?
- A.Memorizing algorithms from textbooks
- B.Avoiding any structured approach
- C.Defining clear steps to solve problems✓ Correct
- D.Thinking about hardware components
Explanation
Clear step-by-step solutions.
Report an error in this question
Algorithmic ThinkingEasy
Q2. Simplest search?
- A.Hash lookup
- B.Jump search
- C.Linear search✓ Correct
- D.Binary search
Explanation
Checks each element sequentially.
Report an error in this question
Algorithmic ThinkingEasy
Q3. Binary search requires?
- A.Only integer type values
- B.An odd length data array
- C.A sorted list of elements✓ Correct
- D.An empty list as input
Explanation
Sorted data required.
Report an error in this question
Algorithmic ThinkingEasy
Q4. Bubble sort idea?
- A.Insert each into a sorted tree
- B.Select the minimum each time
- C.Swap adjacent wrong-order elements✓ Correct
- D.Divide the array in half first
Explanation
Adjacent element swapping.
Report an error in this question
Algorithmic ThinkingEasy
Q5. What is sorting?
- A.Copying data to a new place
- B.Deleting unwanted elements
- C.Searching for an element
- D.Arranging in a specific order✓ Correct
Explanation
Arranging in order.
Report an error in this question
Algorithmic ThinkingEasy
Q6. Linear search worst case?
- A.O(n)✓ Correct
- B.O(1)
- C.O(log n)
- D.O(n^2)
Explanation
O(n) is the correct answer to this question.
Report an error in this question
Algorithmic ThinkingEasy
Q7. What is greedy?
- A.Best choice at each step locally✓ Correct
- B.Always using recursive functions
- C.Using lots of memory resources
- D.Running very slowly on purpose
Explanation
Locally optimal choices.
Report an error in this question
Algorithmic ThinkingEasy
Q8. What is recursive algorithm?
- A.Calls itself with smaller instances✓ Correct
- B.An algorithm without any loops
- C.An algorithm that runs only once
- D.An algorithm that never repeats
Explanation
Self-calling with smaller inputs.
Report an error in this question
Algorithmic ThinkingEasy
Q9. BFS uses?
- A.Array structure
- B.Stack structure
- C.Hash table
- D.Queue structure✓ Correct
Explanation
Queue for level-by-level.
Report an error in this question
Algorithmic ThinkingEasy
Q10. DFS uses?
- A.Heap structure
- B.Hash table lookup
- C.Queue structure
- D.Stack or recursion✓ Correct
Explanation
Stack/recursion for depth-first.
Report an error in this question
Algorithmic ThinkingMedium
Q11. Binary search complexity?
- A.O(1)
- B.O(log n)✓ Correct
- C.O(n)
- D.O(n^2)
Explanation
O(log n) is the correct answer to this question.
Report an error in this question
Algorithmic ThinkingMedium
Q12. Merge sort complexity?
- A.O(n^2)
- B.O(n log n)✓ Correct
- C.O(n)
- D.O(log n)
Explanation
Always O(n log n).
Report an error in this question
Algorithmic ThinkingMedium
Q13. Quicksort worst case?
- A.O(n log n)
- B.O(n^2)✓ Correct
- C.O(log n)
- D.O(n)
Explanation
O(n^2) with bad pivots.
Report an error in this question
Algorithmic ThinkingMedium
Q14. When greedy over DP?
- A.Always use greedy by default
- B.When the problem is NP-hard
- C.Never use greedy over DP
- D.Greedy-choice property plus optimal substructure✓ Correct
Explanation
When local optimal = global optimal.
Report an error in this question
Algorithmic ThinkingMedium
Q15. What is backtracking?
- A.A data compression approach
- B.Never going back on choices
- C.A sorting algorithm technique
- D.Try solutions, undo failed ones✓ Correct
Explanation
Abandons failed paths.
Report an error in this question
Algorithmic ThinkingMedium
Q16. N-Queens uses?
- A.Greedy approach
- B.Backtracking method✓ Correct
- C.Linear search scan
- D.Dynamic programming
Explanation
Classic backtracking problem.
Report an error in this question
Algorithmic ThinkingMedium
Q17. Dijkstra's is for?
- A.String pattern matching
- B.Balancing binary trees
- C.Shortest paths, non-negative weights✓ Correct
- D.Sorting array elements
Explanation
Single-source shortest paths.
Report an error in this question
Algorithmic ThinkingMedium
Q18. Hash function purpose?
- A.Compressing files for storage
- B.Mapping keys to indices for lookup✓ Correct
- C.Encrypting sensitive user data
- D.Sorting data in an array
Explanation
Average O(1) lookups.
Report an error in this question
Algorithmic ThinkingMedium
Q19. What is stable sort?
- A.Maintains equal elements relative order✓ Correct
- B.A sort using constant space only
- C.A sort that never crashes at all
- D.The fastest sorting algorithm known
Explanation
Preserves relative order.
Report an error in this question
Algorithmic ThinkingMedium
Q20. Which sort is not comparison-based?
- A.Heap sort
- B.Counting sort✓ Correct
- C.Quick sort
- D.Merge sort
Explanation
Counting sort: no comparisons.
Report an error in this question
Algorithmic ThinkingHard
Q21. Comparison sort lower bound?
- A.O(log n)
- B.O(n log n)✓ Correct
- C.O(n)
- D.O(n^2)
Explanation
Omega(n log n).
Report an error in this question
Algorithmic ThinkingHard
Q22. What is approximation algorithm?
- A.Produces random unpredictable results
- B.Always gives exact solutions
- C.Near-optimal with provable guarantees✓ Correct
- D.Tries all solutions by brute force
Explanation
Provable quality bounds.
Report an error in this question
Algorithmic ThinkingHard
Q23. What is A*?
- A.A string matching technique
- B.A linear search method only
- C.Best-first search using heuristics✓ Correct
- D.A sorting algorithm for arrays
Explanation
Combines g(n)+h(n) for optimal pathfinding.
Report an error in this question
Algorithmic ThinkingHard
Q24. What is branch and bound?
- A.A tree data structure type
- B.A sorting algorithm approach
- C.A compression technique used
- D.Prunes branches worse than best✓ Correct
Explanation
Prunes unpromising branches.
Report an error in this question
Algorithmic ThinkingHard
Q25. Floyd-Warshall complexity?
- A.O(V^2)
- B.O(V^3)✓ Correct
- C.O(V*E)
- D.O(E log V)
Explanation
Three nested loops: O(V^3).
Report an error in this question
Algorithmic ThinkingHard
Q26. What is randomized algorithm?
- A.An algorithm with no clear structure
- B.An algorithm that has bugs in it
- C.Uses random choices for performance✓ Correct
- D.An algorithm that is always wrong
Explanation
Random choices for performance.
Report an error in this question
Algorithmic ThinkingHard
Q27. Las Vegas vs Monte Carlo?
- A.LV: always correct; MC: may err sometimes✓ Correct
- B.Monte Carlo is always correct output
- C.They are exactly the same algorithm
- D.Las Vegas is always faster in practice
Explanation
LV correct; MC may err.
Report an error in this question
Algorithmic ThinkingHard
Q28. Amortized O(1) dynamic array?
- A.The array never resizes at all
- B.Every single operation is O(1)
- C.Some O(n) resizes, average O(1)✓ Correct
- D.All operations take O(log n)
Explanation
Doubling gives amortized O(1).
Report an error in this question
Algorithmic ThinkingHard
Q29. Kruskal's key idea?
- A.Use DFS for tree construction
- B.Start from a single vertex first
- C.Sort edges, add non-cycle-forming✓ Correct
- D.Use BFS for tree construction
Explanation
Greedily adds lightest safe edges.
Report an error in this question
Algorithmic ThinkingHard
Q30. KMP solves?
- A.Sorting array elements fast
- B.Pattern matching in O(n+m)✓ Correct
- C.Matrix multiplication task
- D.Graph traversal and search
Explanation
O(n+m) pattern matching.
Report an error in this question