# Quiz Part II: Sorting, Searching, and Hierarchical Structures

## Questions of Quiz Part II: Sorting, Searching, and Hierarchical Structures

**1. Which of the following is a divide-and-conquer sorting algorithm?**

- a) Bubble Sort
- b) QuickSort
- c) Insertion Sort
- d) Selection Sort

**2. In a hash table, what is a collision?**

- a) When the hash table becomes full
- b) When two keys hash to the same index
- c) When a hash function fails
- d) When the table needs to be resized

**3. Which traversal technique in a binary search tree will output the values in ascending order?**

- a) Pre-Order Traversal
- b) Post-Order Traversal
- c) In-Order Traversal
- d) Level-Order Traversal

**4. What does a graph's 'degree' refer to?**

- a) The maximum distance between two nodes
- b) The number of edges incident to a node
- c) The number of nodes in the graph
- d) The number of paths from one node to another

**5. What is the worst-case time complexity of binary search?**

- a) O(1)
- b) O(n)
- c) O(log n)
- d) O(n log n)

**6. Which graph algorithm finds the shortest path in a graph with non-negative edge weights?**

- a) Kruskal’s Algorithm
- b) Dijkstra's Algorithm
- c) Depth-First Search
- d) Breadth-First Search

**7. What is the main advantage of a balanced binary tree over an unbalanced binary tree?**

- a) It can store more elements
- b) Better time complexity for insertions, deletions, and lookups
- c) It requires less memory
- d) It is easier to implement

**8. In a hash table using chaining to resolve collisions, what data structure is commonly used to store elements that hash to the same bucket?**

- a) Another hash table
- b) Array
- c) Linked list
- d) Binary tree

**9. Which of these is not a method of open addressing in hash tables?**

- a) Linear Probing
- b) Quadratic Probing
- c) Double Hashing
- d) Chaining

**10. What type of graph traversal is typically used in solving puzzles like mazes?**

- a) Breadth-First Search
- b) Depth-First Search
- c) Topological Sort
- d) Dijkstra's Algorithm

## Questions of Quiz Part II: Sorting, Searching, and Hierarchical Structures

**1. Which of the following is a divide-and-conquer sorting algorithm?**

- a) Bubble Sort
- b) QuickSort
- c) Insertion Sort
- d) Selection Sort

**2. In a hash table, what is a collision?**

- a) When the hash table becomes full
- b) When two keys hash to the same index
- c) When a hash function fails
- d) When the table needs to be resized

**3. Which traversal technique in a binary search tree will output the values in ascending order?**

- a) Pre-Order Traversal
- b) Post-Order Traversal
- c) In-Order Traversal
- d) Level-Order Traversal

**4. What does a graph's 'degree' refer to?**

- a) The maximum distance between two nodes
- b) The number of edges incident to a node
- c) The number of nodes in the graph
- d) The number of paths from one node to another

**5. What is the worst-case time complexity of binary search?**

- a) O(1)
- b) O(n)
- c) O(log n)
- d) O(n log n)

**6. Which graph algorithm finds the shortest path in a graph with non-negative edge weights?**

- a) Kruskal’s Algorithm
- b) Dijkstra's Algorithm
- c) Depth-First Search
- d) Breadth-First Search

**7. What is the main advantage of a balanced binary tree over an unbalanced binary tree?**

- a) It can store more elements
- b) Better time complexity for insertions, deletions, and lookups
- c) It requires less memory
- d) It is easier to implement

**8. In a hash table using chaining to resolve collisions, what data structure is commonly used to store elements that hash to the same bucket?**

- a) Another hash table
- b) Array
- c) Linked list
- d) Binary tree

**9. Which of these is not a method of open addressing in hash tables?**

- a) Linear Probing
- b) Quadratic Probing
- c) Double Hashing
- d) Chaining

**10. What type of graph traversal is typically used in solving puzzles like mazes?**

- a) Breadth-First Search
- b) Depth-First Search
- c) Topological Sort
- d) Dijkstra's Algorithm

## Questions of Quiz Part II: Sorting, Searching, and Hierarchical Structures

**1. Which of the following is a divide-and-conquer sorting algorithm?**

- a) Bubble Sort
- b) QuickSort
- c) Insertion Sort
- d) Selection Sort

**2. In a hash table, what is a collision?**

- a) When the hash table becomes full
- b) When two keys hash to the same index
- c) When a hash function fails
- d) When the table needs to be resized

**3. Which traversal technique in a binary search tree will output the values in ascending order?**

- a) Pre-Order Traversal
- b) Post-Order Traversal
- c) In-Order Traversal
- d) Level-Order Traversal

**4. What does a graph's 'degree' refer to?**

- a) The maximum distance between two nodes
- b) The number of edges incident to a node
- c) The number of nodes in the graph
- d) The number of paths from one node to another

**5. What is the worst-case time complexity of binary search?**

- a) O(1)
- b) O(n)
- c) O(log n)
- d) O(n log n)

**6. Which graph algorithm finds the shortest path in a graph with non-negative edge weights?**

- a) Kruskal’s Algorithm
- b) Dijkstra's Algorithm
- c) Depth-First Search
- d) Breadth-First Search

**7. What is the main advantage of a balanced binary tree over an unbalanced binary tree?**

- a) It can store more elements
- b) Better time complexity for insertions, deletions, and lookups
- c) It requires less memory
- d) It is easier to implement

**8. In a hash table using chaining to resolve collisions, what data structure is commonly used to store elements that hash to the same bucket?**

- a) Another hash table
- b) Array
- c) Linked list
- d) Binary tree

**9. Which of these is not a method of open addressing in hash tables?**

- a) Linear Probing
- b) Quadratic Probing
- c) Double Hashing
- d) Chaining

**10. What type of graph traversal is typically used in solving puzzles like mazes?**

- a) Breadth-First Search
- b) Depth-First Search
- c) Topological Sort
- d) Dijkstra's Algorithm

## Questions of Quiz Part II: Sorting, Searching, and Hierarchical Structures

**1. Which of the following is a divide-and-conquer sorting algorithm?**

- a) Bubble Sort
- b) QuickSort
- c) Insertion Sort
- d) Selection Sort

**2. In a hash table, what is a collision?**

- a) When the hash table becomes full
- b) When two keys hash to the same index
- c) When a hash function fails
- d) When the table needs to be resized

**3. Which traversal technique in a binary search tree will output the values in ascending order?**

- a) Pre-Order Traversal
- b) Post-Order Traversal
- c) In-Order Traversal
- d) Level-Order Traversal

**4. What does a graph's 'degree' refer to?**

- a) The maximum distance between two nodes
- b) The number of edges incident to a node
- c) The number of nodes in the graph
- d) The number of paths from one node to another

**5. What is the worst-case time complexity of binary search?**

- a) O(1)
- b) O(n)
- c) O(log n)
- d) O(n log n)

**6. Which graph algorithm finds the shortest path in a graph with non-negative edge weights?**

- a) Kruskal’s Algorithm
- b) Dijkstra's Algorithm
- c) Depth-First Search
- d) Breadth-First Search

**7. What is the main advantage of a balanced binary tree over an unbalanced binary tree?**

- a) It can store more elements
- b) Better time complexity for insertions, deletions, and lookups
- c) It requires less memory
- d) It is easier to implement

- a) Another hash table
- b) Array
- c) Linked list
- d) Binary tree

**9. Which of these is not a method of open addressing in hash tables?**

- a) Linear Probing
- b) Quadratic Probing
- c) Double Hashing
- d) Chaining

**10. What type of graph traversal is typically used in solving puzzles like mazes?**

- a) Breadth-First Search
- b) Depth-First Search
- c) Topological Sort
- d) Dijkstra's Algorithm