Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 26 pages
Exam (elaborations)

CS6515 EXAM 3 NEWEST VERSION 2026 COMPLETE 46+ QUESTIONS AND CORRECT DETAILED ANSWERS (VERIFIED ANSWERS) |ALREADY GRADED A+.

Document preview thumbnail
Preview 3 out of 26 pages

CS6515 EXAM 3 NEWEST VERSION 2026 COMPLETE 46+ QUESTIONS AND CORRECT DETAILED ANSWERS (VERIFIED ANSWERS) |ALREADY GRADED A+.

Content preview

CS6515 EXAM 3 NEWEST VERSION 2026 COMPLETE 46+ QUESTIONS AND
CORRECT DETAILED ANSWERS (VERIFIED ANSWERS) |ALREADY GRADED A+.
Course
CS6515
1. What is the time complexity of binary search on a sorted array of size n?
A. O(1)
B. O(log n)
C. O(n)
D. O(n²)
Answer: B. O(log n)
Explanation:
Binary search repeatedly divides the search space in half. After k divisions:
n/2k=1n/2^k = 1n/2k=1
which gives:
k=log2nk = log_2 nk=log2n
Therefore, the running time is O(log n).



2. Which algorithm design technique solves a problem by breaking it into smaller
independent subproblems?
A. Greedy method
B. Divide and conquer
C. Backtracking
D. Branch and bound
Answer: B. Divide and conquer
Explanation:
Divide-and-conquer algorithms:
1. Divide the problem into smaller subproblems.
2. Solve each recursively.
3. Combine solutions.
Examples:
 Merge sort

,  Quick sort
 Binary search



3. What is the worst-case time complexity of merge sort?
A. O(n)
B. O(log n)
C. O(n log n)
D. O(n²)
Answer: C. O(n log n)
Explanation:
Merge sort divides the array log n times and performs n work during each merge step.
T(n)=2T(n/2)+O(n)T(n)=2T(n/2)+O(n)T(n)=2T(n/2)+O(n)
Using the Master Theorem:
T(n)=O(nlogn)T(n)=O(nlogn)T(n)=O(nlogn)



4. Which data structure is typically used for implementing Breadth-First Search (BFS)?
A. Stack
B. Queue
C. Heap
D. Hash table
Answer: B. Queue
Explanation:
BFS explores nodes level-by-level. A queue maintains the order in which vertices are discovered.



5. What is the main purpose of asymptotic analysis?
A. Measure exact execution time
B. Compare algorithm efficiency as input size grows
C. Calculate memory addresses
D. Eliminate recursion
Answer: B

, Explanation:
Asymptotic analysis describes algorithm growth rate independent of hardware or programming
language.
Common notations:
 O(g(n)): upper bound
 Ω(g(n)): lower bound
 Θ(g(n)): tight bound



6. Which sorting algorithm has an average-case complexity of O(n log n)?
A. Bubble sort
B. Selection sort
C. Quick sort
D. Linear search
Answer: C
Explanation:
Quick sort:
 Average case: O(n log n)
 Worst case: O(n²)
Worst case occurs when the pivot creates extremely unbalanced partitions.



7. Dynamic programming is most useful when a problem has:
A. Random inputs only
B. Overlapping subproblems and optimal substructure
C. No recursion
D. Only one solution
Answer: B
Explanation:
Dynamic programming stores solutions to repeated subproblems.
Examples:
 Fibonacci sequence

Document information

Uploaded on
July 31, 2026
Number of pages
26
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
YONGHEY
3.7
(6)
Sold
43
Followers
5
Items
900
Last sold
3 days ago


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