#algorithms
Read more stories on Hashnode
Articles with this tag
Problem Given an array, find the nearest smaller element G[i] for every element A[i] in the array such that the element has an index smaller than i....
Problem statement You are given a sorted array ‘arr’ of length ‘n’, which contains positive integer positions of ‘n’ gas stations on the X-axis. You...
Problem Statement Given an array and a sum k, we need to print the length of the longest subarray that sums to k. (link) Note all elements are...
Merge sort approach · Problem Given an array of N integers, count the inversion of the array What is an inversion of an array? Definition: for all i & j...
Selection, Bubble, Insertion, Merge, and Quick Sort · Selection Sort Select the minimums and swap it Minimum at the front Algorithm Step 1 - Swap index...
Problem Statement Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] +...