Application Based Problems
Data structures is a programmic way of storing data. Almost every application uses various types of data structures in one or the other way. Hence it is important to understand the application of data structures and how to implement them in real world scenarios. Doing application based problems helps us to understand the implementation of data structures and algorithms in different use cases.
Binary Search
Binary Search is a fast divide and conquer-based search algorithm with logarithmic run time complexity. It works on a sorted set of elements.The algorithm works by repeatedly dividing in half the portion of the list that could contain the item until the possible positions are narrowed down to just one. The approach is to start with an interval that covers the complete list of items. If the value of the target element is less than the item in the middle of the interval, narrow down the interval to the left half. Otherwise, narrow down the interval to the upper half. Repeat the process until the interval is narrowed down to just one element.
Aggressive Cows
By Yukti Kumari
● Published At Oct 2021
This article explains the solution to a famous problem, “Aggressive Cows”, ranging from brute force to most optimal.... Keep reading ..
Book Allocation Problem
By Yukti Kumari
● Published At Oct 2021
This article explains how to solve the Book Allocation problem and provides both the brute force and binary search approaches.... Keep reading ..
Binary Search Vs Ternary Search
By Shreya Deep
● Published At Oct 2021
In this article, we’ll learn the difference between binary search and ternary search in terms of their time complexities.... Keep reading ..
Ternary Search
By Reet Maggo
● Published At Oct 2021
This article will explain the Ternary Search technique and its working with the help of a code snippet and algorithm for the given example.... Keep reading ..
Square Root using binary search
By Nishant Rana
● Published At Oct 2021
This blog will cover how we can calculate the Square Root(sqrt) of a given number in Log(n) time using Binary Search.... Keep reading ..
Divide the Chocolate
By Nishant Rana
● Published At Oct 2021
In this blog, we will cover the Divide the Chocolate question and discuss Time and Space complexity.... Keep reading ..
Find the minimum element in a sorted and Rotated Array
● Published At Oct 2021
This blog discusses an important interview question: Finding the minimum element in a sorted and rotated array.... Keep reading ..
Minimum coverage by heaters
By Ayush Tiwari
● Published At Jan 2022
This blog finds the minimum heaters range so it can warm all the houses.... Keep reading ..
Plates Between Candles
By GAZAL ARORA
● Published At Nov 2021
In this blog, you will solve a medium-level Leetcode programming question named "Plates Between Candles." ... Keep reading ..
To Find the Nth Number in the Merged and Sorted Lists of Given Ranges.
By Soumya Agrawal
● Published At Mar 2022
This blog will cover the implementation of the problem where we aim to find the Nth number in the merged and sorted lists of given ranges.... Keep reading ..
Array Rotation
The first data structure introduced to us when we start programming is an array. Array Rotation means shifting the array elements to the left or right of the array by specified positions. An array can be rotated to the left(clockwise) or the right (anti-clockwise) to the given number of positions. This category contains everything you need to know about array rotations, from common interview questions to diverse solving techniques.
Find the Maximum Sum of i*arr[i] Among all Possible Rotations of an Array
By Mohammed Afzal
● Published At Oct 2021
This article finds the maximum sum of i*arr[i] among all possible rotations allowed on a given array.... Keep reading ..
Multiple left rotations of an array with O(1)
● Published At Oct 2021
Reversal algorithm for right rotation of an array
By Yukti Kumari
● Published At Oct 2021
This article deals with the reversal algorithm for right rotation of an array and its implementation, time and space complexities.... Keep reading ..
Reversal Algorithm for Array Rotation
By Rubleen Kaur Hanspal
● Published At Oct 2021
This article discusses the Reversal Algorithm for Array rotation. It also calculates the time and additional space complexity of the algorithm.... Keep reading ..
Rotation Count
By Raksha jain
● Published At Oct 2021
This blog discusses in detail Rotation Count, i.e., no of times a sorted array of distinct elements is rotated.... Keep reading ..
Program for Array Rotation in Java
By Rubleen Kaur
● Published At Oct 2021
This article discusses the different ways in which we can perform Array Rotation. Read more to find about the efficient ways and types of Array Rotations.... Keep reading ..
Sort a Rotated Sorted Array
● Published At Oct 2021
This blog is focused on methods we can use for sorting a rotated sorted array of distinct elements. Read further to learn these methods in detail.... Keep reading ..
Rearrangements
Rearrangements are all about changing the order of elements in an array or characters in strings. There are various problems which fall under this category where we are not required to preserve the ordering of elements such as performing sorting, rotations or rearranging the elements according to a given criteria. This category contains everything you need to know about rearrangements , from common interview questions to diverse solving techniques.
Subarray and Subsequences
Subarrays and Subsequences are some of the key terms which are frequently used in problems involving data structures and algorithms. These are similar concepts but have some important differences. Subarray: A subarray is a contiguous sequence of elements in an array. Both empty array and the full array are also subarrays. Subsequence: A subsequence is defined as a sequence that can be derived from another sequence by deletion of zero or some elements without changing the order of remaining elements. Subsequences need not be contiguous like subarrays but still need to preserve the ordering of elements in the original sequence. This category contains everything you need to know about array subarrays and subsequences , from common interview questions to diverse solving techniques.
Sorting
Sorting is the process of arranging data in a logical order to analyze it more effectively. Sorting has distinct meanings for different types of data. For example, we sort text data in alphabetical order and numerical data in numerical order. Numerical and lexicographical orders are the most prevalent, and they can be ascending or descending. Sorting is essential for optimizing the performance of other algorithms that require sorted input data. This category brings to you the various types of Sorting Algorithms their complexity analysis. Not only this, you can find common interview questions and diverse techniques for solving these problems.
Sort a Rotated Sorted Array
● Published At Oct 2021
This blog is focused on methods we can use for sorting a rotated sorted array of distinct elements. Read further to learn these methods in detail.... Keep reading ..
Practice Problems
Sorting problems are commonly asked in programming competitions. It may be difficult for a newbie to solve these challenges at first. This section will cover the most common programming interview questions, bringing you one step closer to your dream job.
Moore’s Voting Algorithm
By Nishant Rana
● Published At Dec 2021
This blog will cover Moore’s Voting algorithm to find the Majority Element and discuss its Time and Space complexity.... Keep reading ..
Next Greater and Smaller Element for Every Element in an Array
By Neelakshi Lahiri
● Published At Oct 2021
The program to find the next greater and smaller element for every element in an array is common in coding interviews. Its solution is discussed in this article. ... Keep reading ..
Max XOR of Two Numbers in an Array
● Published At Oct 2021
Finding the Maximum XOR of two elements in an array is one of the most important interview problems. This article discusses the solution for this. ... Keep reading ..
K’th Largest Element in an array
● Published At Oct 2021
Finding K’th largest element in an array is a vital operation to learn. There are multiple approaches for this which are discussed in the blog.... Keep reading ..
Find Smallest Missing Positive Integer
By Ishita Chawla
● Published At Oct 2021
In this blog, we will be discussing four different approaches to finding the smallest missing positive integer in an unsorted array. ... Keep reading ..
Two Best Non-Overlapping Events
By Aman Chourasiya
● Published At Nov 2021
In this blog, we will discuss a problem involving binary search and a tricky construction. We will learn a tricky construction that proves to be very useful to solve problems based on intervals.... Keep reading ..
Binary Subarrays with Sum
By Husen Kagdi
● Published At Dec 2021
This article discusses the Binary Subarrays with Sum along with different approaches followed by the Implementation in C++, Python, and Java. ... Keep reading ..