Skip to content
All Hard Articles
If we use Radix Sort to sort n integers in the range (nk/2,nk], for some k>0 which is independent of n, the time taken would… Read More
Assume that a main memory with only 4 pages, each of 16 bytes, is initially empty. The CPU generates the following sequence of virtual addresses… Read More
Given a huge file having dynamic data, write a program to read last n lines from the file at any point without reading the entire… Read More
What is the largest integer m such that every simple connected graph with n vertices and n edges contains at least m different spanning trees?… Read More
The Boy or Girl problem consists of a bunch of questions in probability which has kept the mathematicians on discussion about its possibilities.  But different… Read More
Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the… Read More
Consider the solution to the bounded buffer producer/consumer problem by using general semaphores S, F, and E. The semaphore S is the mutual exclusion semaphore… Read More
Which one of the choices given below would be printed when the following program is executed? #include void swap (int *x, int *y) {     static… Read More
John earns 33.33% more than Peter. By what percentage is Peter’s earning less than that of John’s? (A) 22 % (B) 25 % (C) 26… Read More
Question: Ticket Scalpers: Given an array of tickets held by n scalpers. The cost of a ticket at the scalper is equal to the number… Read More
Given a 4×4 board with 15 tiles (every tile has one number from 1 to 15) and one empty space. The objective is to place… Read More
External sorting is a term for a class of sorting algorithms that can handle massive amounts of data. External sorting is required when the data… Read More
Given an ancestor matrix mat[n][n] where Ancestor matrix is defined as below.  mat[i][j] = 1 if i is ancestor of j mat[i][j] = 0, otherwise… Read More
I got a call from amazon for opening in SDE – I. It started with a online screening round and followed by one telephonic and… Read More
Dijkstra’s shortest path algorithm runs in O(Elog V) time when implemented with adjacency list representation (See C implementation and STL based C++ implementations for details).… Read More
We strongly recommend to refer below article before moving on to this article. Push Relabel Algorithm | Set 1 (Introduction and Illustration) Problem Statement :… Read More
Three pipes A, B and C were opened to fill a tank. Working alone, A, B and C require 10, 15 and 20 hours respectively.… Read More
All the data structures discussed here so far are non-persistent (or ephermal). A persistent data structure is a data structure that always preserves the previous… Read More
Given a graph G and an integer K, K-cores of the graph are connected components that are left after all vertices of degree less than… Read More
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v… Read More