## 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 »

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

The running time of the following algorithm Procedure A(n) If n

## 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 »

## Algorithms | Misc | Question 5

The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is (A)… Read More »

## Algorithms | Analysis of Algorithms | Question 13

Consider the following functions: f(n) = 2^n g(n) = n! h(n) = n^logn Which of the following statements about the asymptotic behavior of f(n), g(n),… Read More »

## Algorithms | Graph Traversals | Question 12

The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is… 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 »

## Arrange given numbers to form the biggest number | Set 1

Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548,… Read More »

## Algorithms | Sorting | Question 18

Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains… 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 »

## Algorithms | Graph Shortest Paths | Question 3

Dijkstra’s single source shortest path algorithm when run from vertex a in the below graph, computes the correct shortest path distance to (A) only vertex… 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 »

## Amazon Interview | Set 20

Recently got interviewed with amazon Hyderabad for SDE1. Written 1) Given a BST, along with left and right pointer for a node, it has forward… 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 »