DATA STRUCTURE


vinaykhatri
Vinay Khatri 23 October, 2021

Longest Subarray with Contiguous Elements

Problem Given an array of distinct integers, find the length of the longest subarray, which cont…

vinaykhatri
Vinay Khatri 23 October, 2021

Find the smallest subarray length whose sum of elements is >= k

Find the smallest subarray length whose sum of elements is >= k Problem Given an array of …

vinaykhatri
Vinay Khatri 17 October, 2021

Find maximum profit earned by buying and selling shares any number of…

Problem You are provided an array of prices, where prices[i] represents the current price of a s…

vinaykhatri
Vinay Khatri 17 October, 2021

Find Minimum Platforms Needed to Avoid Delay in the Train Arrival

Problem The objective is to identify the minimal number of train platforms necessary for the rai…

vinaykhatri
Vinay Khatri 16 October, 2021

Find Maximum Length Subarray Having an Equal Number of 0’s and 1’s

Problem Given a binary array nums, return the maximum length of a contiguous subarray with an eq…

vinaykhatri
Vinay Khatri 16 October, 2021

Sort an array 0s, 1s and 2s (Dutch National Flag Problem)

Problem Given an array containing only 0s, 1s and 2s. Write an efficient algorithm to sort the a…

vinaykhatri
Vinay Khatri 16 October, 2021

Maximum Difference Between Two Elements Such that Larger Element Appe…

Problem Find the maximum difference between two array elements such that the bigger element appe…

vinaykhatri
Vinay Khatri 16 October, 2021

Find Maximum Subarray Sum

Problem The objective is to find the elements of a continuous subarray nums of integers that hav…

vinaykhatri
Vinay Khatri 16 October, 2021

Maximum Sum Circular Subarray

Problem Given a circular integer array nums of length n, return the maximum possible sum of a no…

vinaykhatri
Vinay Khatri 16 October, 2021

Subarray with Sum k

Problem Given an unsorted array arr of size N, find a contiguous subarray that adds to a given n…

vinaykhatri
Vinay Khatri 16 October, 2021

Check if a Binary Tree is Height-Balanced or Not

Problem Given a binary tree. You need to check if it is height-balanced or not. A tree is heigh…

ramyashankar
Ramya Shankar 16 October, 2021

Convert a Binary Tree to Its Mirror Tree

A binary tree is an important data structure. It has numerous applications in programming. A binary…