

Sort an array of 0s, 1s and 2s | SDE Sheet | Array
source link: https://www.geeksforgeeks.org/videos/sort-an-array-of-0s-1s-and-2s-sde-sheet-array/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

- 70 Views
- 07/04/2022
Sorting is one of the very famous operations we use in our day to day life. In this video we will see how we sort an array of 0s,1s and 2s in such a way that all 0s come first, then 1s and then 2s.
Example: Input: {0, 1, 2, 0, 1, 2} Output: {0, 0, 1, 1, 2, 2}
Check out the video to see how we implement this!!
Practice Problem: https://practice.geeksforgeeks.org/problems/equilibrium-point-1587115620/1 Article: https://www.geeksforgeeks.org/find-element-array-sum-left-array-equal-sum-right-array/ SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/
Recommend
-
9
Leaders in an ArrayLeaders in an Array | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -0:0070 Views
-
5
Equilibrium pointEquilibrium point | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -0:00360 Views
-
6
Reverse array in groupsReverse array in groups | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -0:00120...
-
6
Missing number in arrayMissing number in array | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -0:0012/...
-
8
Kadane’s AlgorithmKadane’s Algorithm | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -0:00460 Views
-
12
Subarray with given sumSubarray with given sum | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%Remaining Time -9:28280...
-
7
Searching and SortingBinary Search | SDE Sheet | Searching and SortingVideo Player is loading.Loaded: 0%00:00Remaining Time -14:43...
-
9
Stock buy and sellStock buy and sell | SDE Sheet | ArraysVideo Player is loading.Loaded: 0%00:00Remaining Time -11:45
-
12
Array Subset of another arrayArray Subset of another array | SDE Sheet | HashingHi. In today's video we20 Views...
-
6
Given a Linked list of 0s, 1s and 2s, sort itCourses
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK