Search Header Logo

Code Uncode 4.0

Authored by Kathan Majithia

Computers

University

Used 2+ times

Code Uncode 4.0
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

KMP string matching algorithm runs in?

O(nm)
O(n+m)
O(n logm)
O(n^2)

Answer explanation

Preprocess pattern in O(m), search in O(n). Total linear.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many maximum edges are there in a simple undirected graph with V vertices?

V^2
V(V-1)/2
V-1
V(V-1)

Answer explanation

A Complete graph has exactly V(V-1)/2 edges.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of Bellman-Ford?

O(VE)
O(V logV)
O(E logV)
O(V+E)

Answer explanation

Relax edges V-1 times O(VE). Handles negative weights.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which traversal does not construct a unique BST?

Preorder + Postorder
Inorder + Preorder
Inorder + Postorder
Level order

Answer explanation

Inorder + any one traversal (pre/post) uniquely defines BST.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Time to build a heap from n elements?

O(n log n)
O(n)
O(log n)
O(n^2)

Answer explanation

Heapify bottom-up costs linear

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Topological sort is possible when the graph is?

Directed Acyclic Graph
Any directed graph
Undirected cycle-free
Weighted graph

Answer explanation

Only DAGs admit valid topological ordering.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the space complexity of recursive DFS on a graph with V vertices?

0(1)
O(V+E)
O(E)
O(V)

Answer explanation

Call stack depth up to V in worst case.

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?