# Category Archives: Data Structures

The atoi() function in C takes a string (which represents an integer) as an argument and returns its value of type int. So basically the… Read More
An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are placed alternatively. A… Read More
Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if… Read More
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars whose heights… Read More
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity,… 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
A binary tree is a tree data structure in which each node can have at most two children, which are referred to as the left… Read More
The cost of a stock on each day is given in an array. Find the maximum profit that you can make by buying and selling… Read More
Given a Binary Search Tree (BST) and a range [min, max], remove all keys which are outside the given range. The modified tree should also… Read More
Given an array of size n, the array contains numbers in the range from 0 to k-1 where k is a positive integer and k… Read More
Write a program to convert an Infix expression to Postfix form. Infix expression: The expression of the form “a operator b” (a + b) i.e.,… Read More
Given a set of time intervals in any order, merge all overlapping intervals into one and output the result which should have only mutually exclusive… Read More
Given Linked List Representation of Complete Binary Tree, construct the Binary tree. A complete binary tree can be represented in an array in the following… Read More
Pre-requisite: What is Heap Sort? Heapsort is a comparison-based sorting technique based on a Binary Heap data structure. It is similar to selection sort where… Read More
Heap sort is a comparison-based sorting technique based on the Binary Heap data structure. It is similar to the selection sort where first find the… Read More