Search Header Logo

Fundamentals of Algorithms and Design

Authored by Vignesh Rajkumar

English

University

Used 1+ times

Fundamentals of Algorithms and Design
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

What is the time complexity of a binary search algorithm?

O(n)

O(log n)

O(1)

O(n log n)

2.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Explain the difference between Big O, Big Θ, and Big Ω notations.

Big O is for lower bounds, Big Θ is for upper bounds, and Big Ω is for tight bounds.

Big O is for upper bounds, Big Θ is for tight bounds, and Big Ω is for lower bounds.

Big O is for average case, Big Θ is for worst case, and Big Ω is for best case.

Big O is for constant time, Big Θ is for linear time, and Big Ω is for exponential time.

3.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Which data structure would you use to implement a priority queue?

Linked list

Binary heap

Stack

Array

4.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Aarav is designing a recursive function to help him sort a list of books. He realizes that the function uses O(n) space to store the intermediate results. What is the space complexity of Aarav's recursive function?

O(n^2)

O(1)

O(n)

O(log n)

5.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Describe the process of depth-first search (DFS) in graph traversal.

DFS only explores the shortest path in a graph.

DFS visits all nodes in a random order.

DFS requires a queue to keep track of nodes.

Depth-first search (DFS) explores a graph by going as deep as possible along each branch before backtracking.

6.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

What is the primary advantage of using a hash table over a binary search tree?

Faster average-case time complexity for lookups, insertions, and deletions.

Easier to implement than a binary search tree.

More efficient memory usage than a binary search tree.

Better suited for ordered data than a binary search tree.

7.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

How does the merge sort algorithm achieve its time complexity of O(n log n)?

Merge sort has a time complexity of O(n) due to its linear merging process.

Merge sort achieves O(n log n) by sorting the array in a single pass.

Merge sort achieves a time complexity of O(n log n) by recursively dividing the array and merging sorted halves.

Merge sort uses a bubble sort technique to achieve O(n log n).

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?