Friday, May 4, 2018

DS Quespaper

  1. Search, insert and delete in an unsorted array
  2. Search, insert and delete in a sorted array
  3. Given an array A[] and a number x, check for pair in A[] with sum as x
  4. Majority Element
  5. Find the Number Occurring Odd Number of Times
  6. Find the Missing Number
  7. Searching in an array where adjacent differ by at most k
  8. Merge an array of size n into another array of size m+n
  9. Searching in an array where adjacent differ by at most k
  10. Maximum Subarray Sum Excluding Certain Elements
  11. Leaders in an array
  12. Find the only repetitive element between 1 to n-1
  13. Sort elements by frequency | Set 1
  14. Count Inversions in an array | Set 1 (Using Merge Sort)
  15. Two elements whose sum is closest to zero
  16. Shortest Un-ordered Subarray
  17. Shortest Un-ordered Subarray
  18. Check for Majority Element in a sorted array
  19. Union and Intersection of two sorted arrays
  20. Ceiling in a sorted array
  21. Find the two repeating elements in a given array
  22. Sort an array of 0s, 1s and 2s
  23. Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted
  24. Equilibrium index of an array
  25. Count number of occurrences (or frequency) in a sorted array
  26. Find the repeating and the missing | Added 3 new methods
  27. Median in a stream of integers (running integers)
  28. Find a Fixed Point in a given array
  29. Find sub-array with given sum
  30. Find a triplet that sum to a given value
  31. Find the two numbers with odd occurrences in an unsorted array
  32. Find a pair with the given difference
  33. Find four elements that sum to a given value | Set 1 (n^3 solution)
  34. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  35. Median of two sorted arrays of different sizes
  36. Count the number of possible triangles
  37. Find a peak element
  38. Find number of pairs (x, y) in an array such that x^y > y^x
  39. Count all distinct pairs with difference equal to k
  40. Find if there is a sub-array with 0 sum
  41. Given a sorted array and a number x, find the pair in array whose sum is closest to x
  42. Count 1’s in a sorted binary array
  43. Print All Distinct Elements of a given integer array
  44. Construct an array from its pair-sum array
  45. Find common elements in three sorted arrays
  46. Find the first repeating element in an array of integers
  47. Find position of an element in a sorted array of infinite numbers
  48. Check if a given array contains duplicate elements within k distance from each other
  49. Find the element that appears once
  50. Find Union and Intersection of two unsorted arrays
  51. Delete an element from array (Using two traversals and one traversal)
  52. Count frequencies of all elements in array in O(1) extra space and O(n) time
  53. Trapping Rain Water
  54. Count triplets with sum smaller than a given value
  55. Count Inversions of size three in a given array
  56. Merge two sorted arrays with O(1) extra space
  57. Find lost element from a duplicated array
  58. Count pairs with given sum

  1. Search, insert and delete in an unsorted array
  2. Search, insert and delete in a sorted array
  3. Given an array A[] and a number x, check for pair in A[] with sum as x
  4. Majority Element
  5. Find the Number Occurring Odd Number of Times
  6. Find the Missing Number
  7. Searching in an array where adjacent differ by at most k
  8. Merge an array of size n into another array of size m+n
  9. Searching in an array where adjacent differ by at most k
  10. Maximum Subarray Sum Excluding Certain Elements
  11. Leaders in an array
  12. Find the only repetitive element between 1 to n-1
  13. Sort elements by frequency | Set 1
  14. Count Inversions in an array | Set 1 (Using Merge Sort)
  15. Two elements whose sum is closest to zero
  16. Shortest Un-ordered Subarray
  17. Shortest Un-ordered Subarray
  18. Check for Majority Element in a sorted array
  19. Union and Intersection of two sorted arrays
  20. Ceiling in a sorted array
  21. Find the two repeating elements in a given array
  22. Sort an array of 0s, 1s and 2s
  23. Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted
  24. Equilibrium index of an array
  25. Count number of occurrences (or frequency) in a sorted array
  26. Find the repeating and the missing | Added 3 new methods
  27. Median in a stream of integers (running integers)
  28. Find a Fixed Point in a given array
  29. Find sub-array with given sum
  30. Find a triplet that sum to a given value
  31. Find the two numbers with odd occurrences in an unsorted array
  32. Find a pair with the given difference
  33. Find four elements that sum to a given value | Set 1 (n^3 solution)
  34. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  35. Median of two sorted arrays of different sizes
  36. Count the number of possible triangles
  37. Find a peak element
  38. Find number of pairs (x, y) in an array such that x^y > y^x
  39. Count all distinct pairs with difference equal to k
  40. Find if there is a sub-array with 0 sum
  41. Given a sorted array and a number x, find the pair in array whose sum is closest to x
  42. Count 1’s in a sorted binary array
  43. Print All Distinct Elements of a given integer array
  44. Construct an array from its pair-sum array
  45. Find common elements in three sorted arrays
  46. Find the first repeating element in an array of integers
  47. Find position of an element in a sorted array of infinite numbers
  48. Check if a given array contains duplicate elements within k distance from each other
  49. Find the element that appears once
  50. Find Union and Intersection of two unsorted arrays
  51. Delete an element from array (Using two traversals and one traversal)
  52. Count frequencies of all elements in array in O(1) extra space and O(n) time
  53. Trapping Rain Water
  54. Count triplets with sum smaller than a given value
  55. Count Inversions of size three in a given array
  56. Merge two sorted arrays with O(1) extra space
  57. Find lost element from a duplicated array
  58. Count pairs with given sum

No comments:

Post a Comment