1. What is the time complexity of the best-known sorting algorithm for a list of n elements in the worst case?
Explanation: The best-known sorting algorithms, like Merge Sort and Heap Sort, have a time complexity of O(n log n) in the worst case.
Report for correction2. Which data structure follows the Last-In-First-Out (LIFO) principle?
Explanation: A Stack follows the Last-In-First-Out (LIFO) principle, where the last element added is the first to be removed.
Report for correction3. Which algorithm is used to find the shortest path in a weighted graph?
Explanation: Dijkstra's Algorithm is used to find the shortest path in a weighted graph.
Report for correction4. What is the main advantage of using a binary search tree (BST)?
Explanation: A Binary Search Tree (BST) offers efficient searching with O(log n) time complexity on average for balanced trees.
Report for correction5. In a hash table, what is the purpose of the hash function?
Explanation: The hash function in a hash table is used to map keys to specific table indices for efficient storage and retrieval.
Report for correction6. Which sorting algorithm has a worst-case time complexity of O(n^2) but is often used for its simplicity?
Explanation: Bubble Sort has a worst-case time complexity of O(n^2) but is commonly used for its simplicity and ease of implementation.
Report for correction7. What data structure is used to implement a queue in computer science?
Explanation: A Linked List is commonly used to implement a queue in computer science due to its efficient insertion and removal of elements.
Report for correction8. In a binary tree, what is the maximum number of children a node can have?
Explanation: In a binary tree, each node can have a maximum of two children.
Report for correction9. Which searching algorithm divides the search interval in half at each step?
Explanation: Binary Search divides the search interval in half at each step, making it efficient for sorted arrays.
Report for correction10. What is the time complexity of the worst-case scenario for Quick Sort?
Explanation: The worst-case time complexity of Quick Sort is O(n^2), but it is typically O(n log n) on average.
Report for correction11. Which data structure allows for efficient insertion and deletion of elements from both ends?
Explanation: A Deque (Double-ended queue) allows for efficient insertion and deletion of elements from both ends.
Report for correction12. In a graph, what is a vertex with no incoming edges called?
Explanation: An isolated vertex in a graph has no incoming edges, meaning it is not connected to any other vertex.
Report for correction13. What is the primary purpose of an algorithm's time complexity analysis?
Explanation: The primary purpose of time complexity analysis is to assess the efficiency of an algorithm in terms of its input size.
Report for correction14. Which sorting algorithm is known for its stability, meaning it maintains the relative order of equal elements?
Explanation: Merge Sort is known for its stability because it maintains the relative order of equal elements.
Report for correction15. What is the main advantage of a breadth-first search (BFS) over a depth-first search (DFS) in graph traversal?
Explanation: The main advantage of BFS over DFS is that it can find the shortest path in unweighted graphs.
Report for correction16. Which data structure is often used to implement recursion in programming?
Explanation: A Stack data structure is often used to implement recursion in programming to manage function calls and memory.
Report for correction17. In a binary search tree (BST), what is the value of a node called with respect to its left and right subtrees?
Explanation: In a binary search tree (BST), the value of a node with respect to its left and right subtrees is called its key value.
Report for correction18. What is the primary purpose of a hash table's collision resolution technique?
Explanation: The primary purpose of a collision resolution technique in a hash table is to resolve conflicts that occur when multiple keys hash to the same index.
Report for correction19. Which sorting algorithm has a time complexity of O(n) in the best case?
Explanation: Radix Sort has a time complexity of O(n) in the best case when the number of digits in the keys is relatively small and constant.
Report for correction20. In a binary heap data structure, which child node is smaller in a min-heap?
Explanation: In a min-heap, the left child node is smaller than the right child node.
Report for correction21. What is the primary purpose of dynamic programming in algorithm design?
Explanation: Dynamic programming in algorithm design is primarily used to optimize algorithms by solving subproblems only once and storing their solutions for reuse.
Report for correction22. Which data structure is suitable for implementing a priority queue?
Explanation: A Binary Heap is a suitable data structure for implementing a priority queue due to its efficient insertion and removal of the highest-priority element.
Report for correction23. What is the primary purpose of an adjacency matrix in graph representation?
Explanation: The primary purpose of an adjacency matrix in graph representation is to store information about the connectivity between vertices.
Report for correction24. What is the term for an algorithm that visits all the vertices of a graph without revisiting any vertex?
Explanation: A Hamiltonian Path is a path in a graph that visits all vertices exactly once without revisiting any vertex.
Report for correction25. What is the primary advantage of a self-balancing binary search tree (BST) over a standard BST?
Explanation: The primary advantage of a self-balancing binary search tree (BST) is that it guarantees a balanced tree structure, preventing degenerate cases and maintaining efficient search operations.
Report for correction