Skip to content

Category Archives: Data Structures

Which of the following data structures is best suited for efficient implementation of priority queue? (A) Array (B) Linked List (C) Heap (D) Stack Answer:… Read More
Consider a situation where a client receives packets from a server. There may be differences in speed of the client and the server. Which data… Read More
Which data structure is best suited for converting recursive implementation to iterative implementation of an algorithm? (A) Queue (B) Stack (C) Tree (D) Graph Answer:… Read More
VMWare interview for MTS-2 position. I Telephonic round 1. Given an array of strings. Find the maximum prefix among all the strings. Ans: First told… Read More
Eulerian Path is a path in a graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path that starts and ends on the… Read More
Given K sorted arrays of size N each, merge them and print the sorted output. Examples: Input: K = 3, N = 4, arr = {… Read More
First of all, a very very big thanks to whole team of geeks for geeks. It is because of them only that I was able… Read More
The Stable Marriage Problem states that given N men and N women, where each person has ranked all members of the opposite sex in order… Read More
In a flow network, an s-t cut is a cut that requires the source ‘s’ and the sink ‘t’ to be in different subsets, and… Read More
A matching in a Bipartite Graph is a set of the edges chosen in such a way that no two edges share an endpoint. A… Read More
Given a set of numbers, find the Length of the Longest Arithmetic Progression (LLAP) in it.  Examples:  set[] = {1, 7, 10, 15, 27, 29}… Read More
The Ford-Fulkerson algorithm is a widely used algorithm to solve the maximum flow problem in a flow network. The maximum flow problem involves determining the… Read More
Given a sorted array arr[] (may be distinct or may contain duplicates) of size N that is rotated at some unknown point, the task is… Read More
Given a Binary Tree and a key, write a function that prints all the ancestors of the key in the given binary tree.For example, consider… Read More
Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL). The left and right pointers in nodes are to be used as previous… Read More