## Algorithms | Graph Minimum Spanning Tree | Question 1

An undirected graph G(V, E) contains n ( n > 2 ) nodes named v1 , v2 ,….vn. Two nodes vi , vj are connected… Read More »

## Algorithms | Sorting | Question 9

Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array… Read More »

## Algorithms | Sorting | Question 23

Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this:… Read More »

## Algorithms | Graph Traversals | Question 2

Traversal of a graph is different from tree because (A) There can be a loop in graph so we must maintain a visited flag for… Read More »

## Algorithms | Analysis of Algorithms | Question 5

Which of the following is not O(n^2)? (A) (15^10) * n + 12099 (B) n^1.98 (C) n^3 / (sqrt(n)) (D) (2^20) * n Answer: (C)… Read More »

## Algorithms | Graph Traversals | Question 1

Which of the following algorithms can be used to most efficiently determine the presence of a cycle in a given graph ? (A) Depth First… Read More »

## Algorithms | Analysis of Algorithms | Question 4

Let w(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. which… Read More »

## Algorithms | Graph Shortest Paths | Question 14

Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by… Read More »

## Algorithms | Greedy Algorithms | Question 1

Which of the following standard algorithms is not a Greedy algorithm? (A) Dijkstra’s shortest path algorithm (B) Prim’s algorithm (C) Kruskal algorithm (D) Huffman Coding… Read More »

## Algorithms | Analysis of Algorithms | Question 3

The recurrence relation capturing the optimal time of the Tower of Hanoi problem with n discs is. (GATE CS 2012) (A) T(n) = 2T(n –… Read More »

## Algorithms | Analysis of Algorithms | Question 2

What is the time complexity of fun()? filter_none edit close play_arrow link brightness_4 code int fun(int n) {   int count = 0;   for (int i… Read More »

## Algorithms | Analysis of Algorithms (Recurrences) | Question 3

What is the worst case time complexity of following implementation of subset sum problem. filter_none edit close play_arrow link brightness_4 code // Returns true if… Read More »

## Algorithms | Analysis of Algorithms | Question 1

What is time complexity of fun()? filter_none edit close play_arrow link brightness_4 code int fun(int n) {   int count = 0;   for (int i =… Read More »

## Algorithms | Sorting | Question 7

Which of the following is not true about comparison based sorting algorithms? (A) The minimum possible time complexity of a comparison based sorting algorithm is… Read More »