Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 974 Bytes

exercises.md

File metadata and controls

32 lines (22 loc) · 974 Bytes

--

Question: [(0,"x"), (1, 12), (0, 34), (1,90), (1,89), (0,"s"),  (1, "7")]

Move all zeros to the begining and all 1s to end without using another list in 
order of n
Input: [(0,"x"), (1, 12), (0, 34), (1,90), (1,89), (0,"s"),  (1, "7")]
Expected Output: [(0,"x"), (0, 34), (0,"s"), (1,89), (1,90), (1, 12),  (1, "7")]

--

Counting Sort:
Q: Sort the numbers containing age of people. Billion numbers.

I maintain an array of 200 numbers. 0th index is for people with 0 yrs....
200th elements contains count of people with 200 age.

--

Check problem.pdf

-- Code the Bubble Sort: https://yongdanielliang.github.io/animation/web/BubbleSortNew.html Insertion Sort Quick Sort - Version with O(n) space complexity. Merge Sort

-- Question: Implement Deletion in Binary Search Tree Look at animation: https://www.cs.usfca.edu/~galles/visualization/BST.html Look at implementaiton in Jul 13 Notebook