NishaSingla1 / DSA

Write DSA Codes into it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do only these Code and save code as CodeNumber_CodeName.cpp eg: 02_PairSum.cpp Find pair with given sum in the array Check if subarray with 0 sum is exists or not Print all sub-arrays with 0 sum Sort binary array in linear time Find a duplicate element in a limited range array Find maximum length sub-array having given sum Find maximum length sub-array having equal number of 0’s and 1’s Find maximum product of two integers in an array Sort an array containing 0’s, 1’s and 2’s (Dutch National Flag Problem) In place merge two sorted arrays Merge two arrays by satisfying given constraints Find index of 0 to replace to get maximum length sequence of continuous ones Shuffle a given array of elements (Fisher–Yates shuffle) Rearrange the array with alternate high and low elements Find equilibrium index of an array Find largest sub-array formed by consecutive integers Find majority element (Boyer–Moore Majority Vote Algorithm) Move all zeros present in the array to the end Replace each element of array with product of every other element without using / operator Find Longest Bitonic Subarray in an array Longest Increasing Subsequence Find maximum difference between two elements in the array by satisfying given constraints Maximum Sum Subarray Problem (Kadane’s Algorithm) Print continuous subarray with maximum sum Maximum Sum Circular Subarray Find all distinct combinations of given length — I Find all distinct combinations of given length with repetition allowed Find maximum sequence of continuous 1’s formed by replacing at-most k zeroes by ones Find minimum sum subarray of given size k Find maximum product subarray in a given array Find subarray having given sum in given array of integers Find the length of smallest subarray whose sum of elements is greater than the given number Find largest number possible from set of given numbers Find the smallest window in array sorting which will make the entire array sorted Find maximum sum path involving elements of given arrays Maximum profit earned by buying and selling shares any number of times Trapping Rain Water within given set of bars Find minimum platforms needed in the station so to avoid any delay in arrival of any train Decode the array constructed from another array Sort an array using one swap Find Triplet with given sum in an array Length of longest continuous sequence with same sum in given binary arrays Reverse every consecutive m elements of the given subarray Maximum Product Subset Problem Find pairs with given difference k in the array Find pairs with given difference k in the array | Constant space solution 4 sum problem | Quadruplets with given sum Print all quadruplets with given sum | 4-sum problem extended Quickselect Algorithm Rearrange array such that A[A[i]] is set to i for every element A[i] Print all Triplets that forms Arithmetic Progression Print all Triplets that forms Geometric Progression Print all combination of numbers from 1 to n having sum n Replace each element of the array by its corresponding rank in the array Print all Triplets in an array with sum less than or equal to given number Group elements of an array based on their first occurrence Find minimum difference between index of two given elements present in the array Find maximum absolute difference between sum of two non-overlapping sub-arrays Find all Symmetric Pairs in an Array of Pairs Partition an array into two sub-arrays with the same sum Find count of distinct elements in every sub-array of size k Find two numbers with maximum sum formed by array digits Print all sub-arrays of an array having distinct elements Find a Triplet having Maximum Product in an Array Find Minimum Index of Repeating Element in an Array Generate random input from an array according to given probabilities Find pair in an array having minimum absolute sum Find Index of Maximum Occurring Element with Equal Probability Check if an Array is Formed by Consecutive Integers Find two non-overlapping pairs having same sum in an array Add elements of two arrays into a new array Find Minimum Product among all Combinations of Triplets in an Array Replace every element of an array with the least greater element on its right Find all odd occurring elements in an array having limited range of elements Count the distinct absolute values in the sorted array Print all combinations of positive integers in increasing order that sum to a given number Find all distinct combinations of given length — II Find subarrays with given sum in an array Find the surpasser count for each element of an array Find maximum length sequence of continuous ones (Using Sliding Window) Find maximum length sequence of continuous ones Find index that divides an array into two non-empty subarrays of equal sum Calculate frequency of all elements present in an array of specified range Rearrange the array such that it contains positive and negative numbers at alternate positions Find a sorted triplet in the given array Shuffle an array according to the given order of elements Count number of strictly increasing sub-arrays in an array Find duplicates within given range k in an array Longest Alternating Subarray Problem Find minimum range with at-least one element from each of the given arrays Find longest subsequence formed by consecutive integers Find all elements in an array that are greater than all elements present to their right Find missing number in array without using extra space Determine index of an element in given array which satisfies given constraints Find minimum moves required for converting a given array to an array of zeroes Left rotate an array Right rotate an array k times Find maximum profit earned from at most two stock transactions Find Frequency of each element in a sorted array containing duplicates Find Minimum and Maximum element in an array using minimum comparisons Difference between Subarray, Subsequence and Subset Find odd occurring element in an array in single traversal Find odd occurring element in logarithmic time Find two odd occurring elements in an array without using any extra space Check if given array represents min heap or not Find K’th smallest element in an array Find K’th largest element in an array Sort a K-Sorted Array Merge M sorted lists of variable length Find smallest range with at-least one element from each of the given lists Merge M sorted lists each containing N elements Find maximum sum of subsequence with no adjacent elements Find ways to calculate a target from elements of specified array Sort elements by their frequency and Index Sort an array based on order defined by another array Inversion Count of an array Segregate positive and negative integers in linear time Find number of rotations in a circularly sorted array Search an element in a circular sorted array Find first or last occurrence of a given number in a sorted array Count occurrences of a number in a sorted array with duplicates Find smallest missing element from a sorted array Find Floor and Ceil of a number in a sorted array Search in a nearly sorted array in logarithmic time Find number of 1’s in a sorted binary array Find Missing Term in a Sequence in Logarithmic time Find missing number and duplicate elements in an array Find the peak element in an array Find Floor and Ceil of a number in a sorted array (Recursive solution) Print all distinct subsets of a given set Find two duplicate elements in a limited range array (using XOR) Combinations of words formed by replacing given numbers with corresponding alphabets 0–1 Knapsack Problem Subset sum Problem Partition Problem 3-Partition Problem 3-partition problem extended | Print all partitions K-Partition Problem | Printing all Partitions Minimum Sum Partition Problem Rod Cutting Longest Alternating Subsequence Problem Coin change-making problem (unlimited supply of coins) Coin Change Problem — Find total number of ways to get the denomination of coins Find maximum profit earned from at most K stock transactions

About

Write DSA Codes into it


Languages

Language:C++ 73.9%Language:Python 11.1%Language:Java 8.4%Language:C 5.4%Language:HTML 0.8%Language:JavaScript 0.3%