## Maximise the number of toys that can be purchased with amount K using min Heap

Given an array arr[] consisting of the cost of toys and an integer K depicting the amount of money available to purchase toys. The task… Read More »

- Rearrange numbers in an array such that no two adjacent numbers are same
- Shortest path from source to destination such that edge weights along path are alternatively increasing and decreasing
- Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array
- Minimum operations required to make every element greater than or equal to K
- Maximum possible sub-array sum after at most X swaps
- Reduce the array to a single integer with the given operation
- Print the final string when minimum value strings get concatenated in every operation
- Maximise the number of toys that can be purchased with amount K using min Heap

Given an array arr[] consisting of the cost of toys and an integer K depicting the amount of money available to purchase toys. The task… Read More »

Given an array of length N. The task is to convert it into a sequence in which all elements are greater than or equal to… Read More »

Given an array of integers. The task is to rearrange elements of the array such that no two adjacent elements in the array are same.… Read More »

Given an array arr[] of N integers and an integer X, the task is to find the maximum possible sub-array sum after applying at most… Read More »

Given an array arr[] of N integers from 1 to N. The task is to perform the following operations N – 1 times. Select two… Read More »

Given an array of strings and an array of integers where ith integer of the array corresponds to the value of the ith string present… Read More »

Given a connected graph with N vertices and M edges. The task is to find the shortest path from source to the destination vertex such… Read More »

Given N elements, you can remove any two elements from the list, note their sum and add the sum to the list. Repeat these steps… Read More »

Given a connected graph with N vertices and M edges. The task is to print the lexicographically smallest BFS traversal of the graph starting from… Read More »

Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More »

Given a max-heap of size n, find the kth greatest element in the max-heap. Examples: Input : maxHeap = {20, 15, 18, 8, 10, 5,… Read More »

Given a min-heap of size n, find the kth least element in the min-heap. Examples: Input : {10, 50, 40, 75, 60, 65, 45} k… Read More »

A max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the… Read More »

A double ended priority queue supports operations of both max heap (a max priority queue) and min heap (a min priority queue). The following operations… Read More »

The spliterator() method of PriorityQueue returns a Spliterator the same elements as PriorityQueue.The returned Spliterator is late-binding and fail-fast Spliterator. A late-binding Spliterator binds to… Read More »