This video contains Must Do Coding Questions for Companies like Amazon, Microsoft, Adobe, …
from geeksforgeeks platform.
website link:
https://www.geeksforgeeks.org/must-do...
Topics covered in this video series are:
1.Arrays
• 1.1 ARRAYS | Must Do Coding Questions
2.String
• 1.2 STRING | Must Do Coding Questions
3.Linked List
• 1.3 LINKED LIST | Must Do Coding Questions
4.Stack and Queue
5.Tree and BST
6.Heap
7.Recursion
8.Hashing
9.Graph
10.Greedy
11.Dynamic Programming
12.Divide and Conquer
13.Backtracking
14.Bit Magic
Linked List:
17: Given a linked list of 0s, 1s and 2s, sort it:
Given a linked list of N nodes where nodes can contain values 0s, 1s, and 2s only. The task is to segregate 0s, 1s, and 2s linked list such that all zeros segregate to head side, 2s at the end of the linked list, and 1s in the mid of 0s and 2s.
Example 1:
Input:
N = 8
value[] = {1,2,2,1,2,0,2,2}
Output: 0 1 1 2 2 2 2 2
Explanation: All the 0s are segregated to the left end of the linked list, 2s to the right end of the list, and 1s in between.
Example 2:
Input:
N = 4
value[] = {2,2,0,1}
Output: 0 1 2 2
Explanation: After arranging all the 0s,1s and 2s in the given format, the output will be 0 1 2 2.
Code Link:
https://github.com/krishna-gavas/Comp...
Intro Music :
• Video p