1. Two Sum Problem

2. Sort an array of 0’s, 1’s and 2’s

3. Majority Element (⌊n/2⌋ times)

4. Kadane’s Algorithm – Maximum Subarray Sum

5. Print subarray with maximum subarray sum (extended version of Kadane’s)

6. Stock Buy and Sell

7. Rearrange the array in alternating positive and negative items


8.Next Permutation

9.Leaders in an Array

10. Longest Consecutive Sequence in an Array

11. Set Matrix Zeros

12. Rotate Matrix by 90 Degrees

13.Print the matrix in spiral manner

14. Count subarrays with given sum