## Algorithms | Graph Minimum Spanning Tree | Question 8February 20, 2013

Consider a weighted complete graph G on the vertex set {v1,v2 ,v} such that the weight of the edge (v,,v) is 2|i-j|. The weight of… Read More »

## Algorithms | Misc | Question 6

An element in an array X is called a leader if it is greater than all elements to the right of it in X. The… Read More »

## Data Structures | Binary Trees | Question 12

A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is… Read More »

## Data Structures | Heap | Question 9

In a binary max heap containing n numbers, the smallest element can be found in time (GATE CS 2006) (A) 0(n) (B) O(logn) (C) 0(loglogn)… Read More »

## Data Structures | Graph | Question 6

How many undirected graphs (not necessarily connected) can be constructed out of a given set V= {V 1, V 2,…V n} of n vertices ?… Read More »

## Data Structures | Graph | Question 5

Consider an undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r. Let d(r, u) and d(r, v)… Read More »

## Algorithms | Graph Traversals | Question 12

Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a… Read More »

## Algorithms | Graph Minimum Spanning Tree | Question 7

Let G be an undirected connected graph with distinct edge weight. Let emax be the edge with maximum weight and emin the edge with minimum… Read More »

## Algorithms | Analysis of Algorithms | Question 15

Consider the following functions Which of the following is true? (GATE CS 2000) (a) h(n) is 0(f(n)) (b) h(n) is 0(g(n)) (c) g(n) is not… Read More »

## Data Structures | Stack | Question 7

Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence,… Read More »

## Data Structures | Binary Search Trees | Question 6

Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree.… Read More »

## Data Structures | Heap | Question 8

In a min-heap with n elements with the smallest element at the root, the 7th smallest element can be found in time a) (n log… Read More »

## Data Structures | Stack | Question 6

The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 *… Read More »

## Algorithms | Sorting | Question 19

Which of the following sorting algorithms has the lowest worst-case complexity? (A) Merge Sort (B) Bubble Sort (C) Quick Sort (D) Selection Sort Answer: (A)… Read More »

## Data Structures | Binary Trees | Question 11

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a… Read More »