• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

Algorithms Quiz - 30 Questions with Answers

Document preview thumbnail
Preview 2 out of 8 pages

This quiz is designed to test and reinforce your understanding of fundamental algorithm concepts, commonly covered in computer science courses, coding interviews, and technical assessments.

Content preview

Algorithms Quiz (30 Questions)



1. What is the time complexity of binary search?

A) O(n)​
B) O(log n)​
C) O(n log n)​
D) O(1)​
Answer: B​
Explanation: Binary search halves the search space each time, so it takes log₂(n) steps.



2. Which algorithm is not comparison-based?

A) Merge Sort​
B) Heap Sort​
C) Quick Sort​
D) Counting Sort​
Answer: D​
Explanation: Counting Sort uses keys as indexes, not comparisons between elements.



3. What is the best case time complexity of Quick Sort?

A) O(n²)​
B) O(n)​
C) O(n log n)​
D) O(log n)​
Answer: C​
Explanation: In the best case, the pivot divides the array evenly each time.



4. Which data structure is used in Breadth-First Search (BFS)?

A) Stack​
B) Queue​
C) Priority Queue​
D) Hash Map​
Answer: B​
Explanation: BFS explores neighbors level by level using a queue.

, 5. What is dynamic programming mainly used for?

A) Real-time systems​
B) Randomization​
C) Optimal substructure problems​
D) Memory management​
Answer: C​
Explanation: DP solves problems by combining solutions to subproblems.



6. What does Big O notation represent?

A) Average runtime​
B) Worst-case scenario​
C) Best-case scenario​
D) Input size​
Answer: B​
Explanation: Big O describes the upper bound on runtime complexity.



7. What is the purpose of memoization?

A) Minimize disk usage​
B) Reduce code size​
C) Optimize recursive calls​
D) Avoid network calls​
Answer: C​
Explanation: Memoization caches results to avoid redundant computations.



8. Dijkstra’s algorithm doesn’t work with graphs containing:

A) Loops​
B) Zero-weight edges​
C) Negative-weight edges​
D) Undirected edges​
Answer: C​
Explanation: Dijkstra’s assumes once a node is visited, it has the shortest path.

Document information

Uploaded on
June 24, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$3.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
1
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions