Unit 5 - Practice Quiz

CSE357 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which of the following data structures is considered a non-linear data structure?

A. Tree
B. Linked List
C. Queue
D. Stack

2 In the context of algorithm analysis, which notation represents the asymptotic upper bound of the time requirement?

A. Big Theta ()
B. Little oh ()
C. Big Oh ()
D. Big Omega ()

3 What is the primary advantage of a Linked List over an Array?

A. Memory locality
B. Random access to elements
C. Dynamic size and efficient insertion/deletion
D. Lower memory overhead per element

4 In a Singly Linked List, what is the time complexity to access the element?

A.
B.
C.
D.

5 Which type of Linked List allows traversal in both forward and backward directions?

A. Doubly Linked List
B. Priority List
C. Circular Singly Linked List
D. Singly Linked List

6 A pointer in a linked list that does not point to any valid memory location is generally referred to as:

A. Void pointer
B. Wild pointer
C. Null pointer
D. Dangling pointer

7 If a circular linked list has a pointer to the last node, what is the time complexity to insert a node at the beginning of the list?

A.
B.
C.
D.

8 Which data structure follows the LIFO (Last In, First Out) principle?

A. Stack
B. Graph
C. Queue
D. Tree

9 What is the result of evaluating the postfix expression: ?

A. 13
B. 20
C. 10
D. 16

10 Which data structure is implicitly used by the system to handle function calls and recursion?

A. Queue
B. Stack
C. Hash Table
D. Heap

11 In a Queue implemented using a circular array of size , the condition for the queue being full is:

A. rear == N - 1
B. (front + 1) % N == rear
C. (rear + 1) % N == front
D. front == rear

12 Which operation removes an element from the front of a Queue?

A. Enqueue
B. Pop
C. Push
D. Dequeue

13 A double-ended queue (Deque) allows insertion and deletion at:

A. The middle
B. Only the rear
C. Only the front
D. Both the front and the rear

14 Implementing a Queue using two Stacks requires how many stacks?

A. 1
B. 3
C. 4
D. 2

15 What is the maximum number of nodes in a binary tree of height (where the root is at height 0)?

A.
B.
C.
D.

16 Which tree traversal visits the root node, then the left subtree, and finally the right subtree?

A. Preorder
B. Inorder
C. Level Order
D. Postorder

17 In a Binary Search Tree (BST), the Inorder traversal produces:

A. Nodes in sorted non-decreasing order
B. Nodes in sorted non-increasing order
C. Nodes based on their level
D. Random order

18 What is the worst-case time complexity for searching in an unbalanced Binary Search Tree?

A.
B.
C.
D.

19 An AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than:

A. 2
B. 1
C. 0
D. Any value

20 The number of edges in a tree with nodes is always:

A.
B.
C.
D.

21 Which data structure is commonly used to implement Breadth-First Search (BFS) in a graph?

A. Queue
B. Heap
C. Stack
D. Hash Map

22 Which data structure is commonly used to implement Depth-First Search (DFS) in a graph?

A. Stack
B. Tree
C. Priority Queue
D. Queue

23 In a graph represented by an Adjacency Matrix , if there is an edge between vertex and vertex , then:

A.
B.
C. (or weight)
D.

24 What is the space complexity of an Adjacency List representation for a graph with vertices and edges?

A.
B.
C.
D.

25 Dijkstra's algorithm is used for:

A. Finding the Minimum Spanning Tree
B. Topological Sorting
C. Finding the Shortest Path from a source node to all other nodes
D. Detecting cycles in a graph

26 Which algorithm is used to find the Minimum Spanning Tree (MST) of a graph?

A. Binary Search
B. DFS
C. Kruskal's Algorithm
D. Floyd-Warshall

27 Topological Sort is applicable to which type of graph?

A. Any Directed Graph
B. Directed Acyclic Graph (DAG)
C. Undirected Acyclic Graph
D. Undirected Cyclic Graph

28 In an undirected graph, the sum of the degrees of all vertices is equal to:

A. The number of edges
B.
C.
D.

29 A complete binary tree has a property that it is filled:

A. Randomly
B. Only on the left side
C. From left to right on the last level
D. From right to left

30 How many different binary trees can be constructed with distinct nodes?

A.
B.
C.
D.

31 Which data structure is best suited for implementing a Priority Queue?

A. Array
B. Stack
C. Linked List
D. Heap

32 In a Max-Heap, the value of a parent node is always:

A. Half of the left child
B. Less than or equal to its children
C. Greater than or equal to its children
D. Equal to the sum of its children

33 If a binary heap is stored in an array (0-indexed), the left child of the node at index is located at:

A.
B.
C.
D.

34 What is the time complexity to insert a new element into a binary heap with elements?

A.
B.
C.
D.

35 Heap Sort has a worst-case time complexity of:

A.
B.
C.
D.

36 A situation where two different keys map to the same index in a Hash Table is called:

A. Overflow
B. Collision
C. Rehashing
D. Clustering

37 Which of the following is a technique to resolve hash collisions?

A. Chaining
B. Merge Sort
C. Binary Search
D. Heapify

38 In Open Addressing, which probing method calculates the interval between probes using a second hash function?

A. Quadratic Probing
B. Double Hashing
C. Linear Probing
D. Separate Chaining

39 The Load Factor () of a hash table is defined as:

A. Number of collisions / Number of buckets
B. Number of elements / Number of buckets
C. Size of largest chain
D. Number of buckets / Number of elements

40 What is the average time complexity for Search, Insert, and Delete operations in a well-implemented Hash Table?

A.
B.
C.
D.

41 Which traversal of a Binary Search Tree (BST) sorts the elements?

A. Postorder
B. Inorder
C. Preorder
D. Level Order

42 What is the height of a balanced binary search tree with nodes?

A.
B.
C.
D.

43 Converting a general tree to a binary tree typically involves the representation:

A. Heap Array
B. Adjacency Matrix
C. Parent Pointer
D. Left-Child, Right-Sibling

44 Which of the following data structures is most appropriate for a dictionary implementation (looking up definitions by words)?

A. Stack
B. Linked List
C. Queue
D. Hash Table

45 A graph is considered connected if:

A. Every vertex has degree 1
B. There are no cycles
C. It is a complete graph
D. There is a path between every pair of vertices

46 In a binary heap, the 'Heapify' operation usually takes time proportional to:

A. Constant time
B.
C. The number of nodes
D. The height of the tree

47 The post-fix form of the expression is:

A.
B.
C.
D.

48 Which data structure is used to check for balanced parentheses in an expression?

A. Queue
B. Stack
C. Linked List
D. Binary Tree

49 Deletion of a node from a Doubly Linked List involves changing how many pointers (assuming the node is not head/tail)?

A. 3
B. 2
C. 4
D. 1

50 In the context of Hashing, what is a 'Perfect Hash Function'?

A. A function that maps every key to a distinct integer with no collisions
B. A function that is very fast to compute
C. A function with load factor 1.0
D. A function that uses cryptographic security