Given M sorted lists of variable length, efficiently compute the smallest range that includes at-least one element from each list.
Given an array and positive integer k, find k’th smallest element in the array.
A stack is a linear data structure that serves as a container of objects that are inserted and removed according to the LIFO (last-in first-out) rule. It has three main operations: push, pop and peek. We have discussed about these operations in previous post and covered array and linked list implementation of stack data structure in …
Given a k-sorted array that is almost sorted such that each of the N elements may be misplaced by no more than k positions from the correct sorted order. Find a space-and-time efficient algorithm to sort the array.
Given an array and positive integer k, find K’th largest element in the array.
Given an array representing a Max Heap, in-place convert the array into the min heap in linear time.
A queue is an linear data structure that serves as a collection of elements, with three main operations: enqueue, dequeue and peek. We have discussed about these operations in previous post and covered array implementation of queue data structure. In this post, linked list implementation of queue is discussed.
Given an array of integers, check if it represents Min-Heap or not.
Given an array of integers, sort it using heap sort algorithm.
A queue is a linear data structure that serves as a collection of elements, with three main operations:
Write a C program to print Right-angled Triangle pattern formed by star(*) character.
In this post, we will discuss various methods to dynamically allocate memory for 2D array in C using Single Pointer, Array of Pointers and Double Pointer.