@@ -30,23 +30,26 @@ Arrays
30
30
6 . Write a program takes array input{1,0,2,3} and num = 3 and provides output {1,2}{0,3}{2,1}{3,0} sum equals the num.
31
31
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/findpairsequaltosum/FindPairsEqualToSum.java
32
32
33
- 7 . Find the contiguous subarray which has the largest sum. Kadane's algorithm.
33
+ 7 . Given a sorted array (ascending order and distinct elements), find i such that inputArr[ i] = i. Return -1 if nothing found.
34
+ Link:
35
+
36
+ 8 . Find the contiguous subarray which has the largest sum. Kadane's algorithm.
34
37
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/maxsubarray/FindMaxSubArray.java
35
38
36
- 8 . Given two sorted (ascending) arrays of integers, find the minimum difference between two integers in that array.
39
+ 9 . Given two sorted (ascending) arrays of integers, find the minimum difference between two integers in that array.
37
40
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/mindiffsortedarrays/MinimumDifferenceSortedArrays.java
38
41
39
- 9 . Print numbers with frequency.
42
+ 10 . Print numbers with frequency.
40
43
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/numberfrequency/PrintNumbersWithFrequency.java
41
44
42
- 10 . Find Number with Highest frequency in sorted array.
45
+ 11 . Find Number with Highest frequency in sorted array.
43
46
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/numberwithhighestfreq/FindNumberWithHighestFreq.java
44
47
45
- 11 . Given an array, write a program to generate a random permutation of array elements.
48
+ 12 . Given an array, write a program to generate a random permutation of array elements.
46
49
Also asked as “shuffle a deck of cards” or “randomize a given array”.
47
50
Link:
48
51
49
- 12 . Search for a number in rotated sorted array.
52
+ 13 . Search for a number in rotated sorted array.
50
53
Link: https://github.com/techpanja/interviewproblems/blob/master/src/arrays/searchrotatedsortedarray/SearchInRotatedSortedArray.java
51
54
52
55
0 commit comments