# Tagged: arrays

## Next Greater Frequency Element

“Next Greater Frequency Element” is a standard problem of stack data structure. Here, in this problem, we are given an array and our task is to write a program to find the next (right side) greater frequency element of every element. If for any particular element next greater frequency element...

## Implement Two Stacks in a Single Array

“Implement Two Stacks in a Single Array” is a popular technical interview problem based on stack data structure. Here, we are given an array of size ‘n’ and our task is to implement two stacks in a single array. We need to ensure that the space in an array is...

## Largest Rectangular Area in Histogram

“Largest Rectangular Area in Histogram” is one of the favorite technical interview problem, asked in many product-based company interview. Problem: We are given a histogram made up of contiguous bars of same width. Our task is to find the largest possible rectangular area.  Example: Length of contiguous bars: {5, 7, 12,...

## Bubble Sort On Linked List

“Bubble Sort On Linked List” is one of the basic problem based on the linked list data structure and sorting algorithm. Here, we are given a linked list and our task is sort the elements of given linked list in ascending order using bubble sort. Example: Linked List Before Sorting:...

Both Linked list and Arrays are linear data structure used to store data. The major difference between array and linked list lies in the structure of the array and linked list and how data is stored in both of them. Related Posts: Introduction to Linked List Insert a New Node...

## Sort an Array of 0s and 1s

“Sort an Array of 0s and 1s” is one of the favorite technical interview problem of array data structure. Here, we are given an array of size ‘n’ and our task is to sort this array.  Array contains only 0s and 1s. Example: INPUT: Arr = {1, 0, 1, 0,...

## Find mean of an Array

“Find mean of an Array” is a basic problem of array data structure. Here, we are given an array of size ‘n’ and our task is to find and print the mean of the array. Mean of an array = (sum of all the elements of the array) / n....

## Find Majority Element of an Array

“Find Majority Element of an Array” is one of the most favorite technical interview problem based on array data structure. Here, we are given an array of size ‘n’ and our task is to find the majority element of the array.  If there is no majority Element, print a message...

## Find Equilibrium Index of an Array

“Find Equilibrium Index of an Array” is one of the favourite technical interview problem based on array data structure. Here, we are given an array of size ‘n’ and our task is to find equilibrium index of an array. Equilibrium index of an array is that index of array where...

## Print Kth Smallest and Kth Largest Element of an Array

“Print Kth Smallest and Kth Largest Element of an Array” is again a basic problem of array data structure. Here, we are given an unsorted array of size ‘n’ and our task is to print kth smallest and kth largest element of an array, where k<=n. Example (Print Kth Smallest...