How to Sort linked list of 0s, 1s and 2s
[Question]: Given a singly linked list head sort it with with all with zeros, ones and two’sExample:Input: 1 -> 1 -> 2 -> 0 -> 2 -> 0 -> 1 -> NULL Output: 0 -> 0 -> 1 -> 1 -> 1 -> 2 -> 2 -> NULL Approach: Create count array which stores count of 0’s, 1’s […]
How to Sort linked list of 0s, 1s and 2s Read More »