Practice Algorithms Questions and Answers
- Which sorting algorithm is not stable by default?
- A directed acyclic graph (DAG) has 10 vertices and 15 edges. What is the maximum possible number of topological orderings?
- The Master Theorem gives time complexity for recurrences of the form:
- Which data structure supports extraction of both min and max in O(1) time and insertion in O(log n)?
- The amortized time for inserting into a dynamic array (like C++ vector) is:
- Which of the following problems cannot be solved using greedy algorithms for optimal result?
- The time complexity of building a heap from an unsorted array of n elements is:
- Which traversal method in a binary search tree retrieves nodes in sorted order?
- The Bellman-Ford algorithm executes relaxation steps how many times for a graph with V vertices?
- Which algorithm is best suited to find the shortest path in a graph with negative edge weights but no negative cycles?
- The time complexity of the best case for QuickSort is:
- In a binary tree, if the number of leaf nodes is L, what is the number of nodes with two children?
- In dynamic programming, overlapping subproblems and _________ are key properties.
- Which data structure is used for implementing recursive function calls?
- What is the time complexity of searching in a balanced binary search tree?
- Which algorithm uses a “divide and conquer” strategy?
- In hashing, what is a collision?
- The minimum number of edges in a connected graph with n vertices is:
- Which algorithm is used to detect cycles in a directed graph?
- Which of the following sorting algorithms has the best worst-case time complexity?
- Which of the following is true for Dijkstra’s algorithm?
- Which data structure is used in BFS (Breadth-First Search)?
- In a Min-Heap, the root node is:
- The time complexity of searching in a hash table with chaining is:
- Which algorithm finds Minimum Spanning Tree in a weighted graph by adding edges in increasing order?
- Dynamic Programming is useful when a problem has:
- Which algorithm uses a priority queue to repeatedly pick the next closest vertex?
- Which of the following is NOT a divide-and-conquer algorithm?
- Which graph traversal technique is commonly used for topological sorting?
- Which of the following is true for the time complexity of binary search?
- Which algorithm finds the shortest paths between all pairs of vertices in a weighted graph?
- In which case is QuickSort’s performance worst?
- Dynamic Programming is preferred over recursion when:
- Which of the following is NOT a greedy algorithm?
- Which of the following sorting algorithms is best for nearly sorted data?
- In a binary search tree (BST), what is true about the left child of a node?
- Which algorithm is used to detect cycles in a directed graph?
- Which of the following is true for a min-heap?
- Which graph traversal method uses a queue?
- Which of the following algorithms uses a greedy approach?
More Topics
- Analog and Digital Communication Questions
- Artificial Intelligence & Machine Language Questions
- Basics of Computers Questions
- Big Data Analytics Questions
- C Programming Questions
- C++ Questions
- Compiler Design Questions
- Computer Architecture and Design Questions
- Cyber Security Questions
- Data Analytics Languages Questions
- Data Structure Questions
- Data Warehousing Questions
- Digital Logic Questions
- IOT and mobile Computing Questions
- IT DBMS Questions
- IT Networking Questions
- IT Operating System Questions
- Machine Learning Questions
- Memory Management Questions
- Microsoft Office Questions
- Network Layer and IP Protocol Questions
- Numerical and Statistical Computing Questions
- Object Oriented Programming Questions
- OOPS Concepts Questions
- Previous Year Questions Questions
- Python Questions
- Shell Scripting Questions
- Software Engineering and Web Technology Questions
- SQL Questions