Tag Archives: Data Structures

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 »

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 »

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 »

Data Structures | Binary Trees | Question 10

A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes… Read More »

Data Structures | Hash | Question 4

Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty,… Read More »

Data Structures | Binary Trees | Question 9

A weight-balanced tree is a binary tree in which for each node. The number of nodes in the left sub tree is at least half… Read More »

Data Structures | Binary Trees | Question 8

The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is: (A) n/2 (B) (n-1)/3… Read More »

Data Structures | Heap | Question 7

We have a binary heap on n elements and wish to insert n more elements (not necessarily one after another) into this heap. The total… Read More »

Data Structures | Linked List | Question 8

The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with… Read More »

Data Structures | Graph | Question 4

The most efficient algorithm for finding the number of connected components in an undirected graph on n vertices and m edges has time complexity. (A)… Read More »

Data Structures | Balanced Binary Search Trees | Question 2

What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree with a single node is 0. (A)… Read More »