Skip to content

Commit 38889cf

Browse files
author
owais4321
committed
added question description to array datastructure index.md
1 parent b7cab9d commit 38889cf

File tree

1 file changed

+99
-11
lines changed

1 file changed

+99
-11
lines changed

data_structures/array/index.md

Lines changed: 99 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,122 @@
11
# Index of array
22

33
* [Permumations of Word](permutations_of_word.py)
4+
5+
Find Permuatation of a given word.
46
* [Common Elements of three sorted arrays](sorted_array_three_common_elements.py)
7+
8+
Find Common elements in three array given that all three arrays are sorted
59
* [Dutch Flag Problem](dutch_flag_problem.py)
10+
11+
Given an array containing only 0s, 1s and 2s in a random order, arrange the array such that all 0s come
12+
before 1s which in turn come before all 2s
13+
14+
Input - [1,2,0,1,2,1,0,1,2,1,0]
15+
16+
Output - [0,0,0,1,1,1,1,1,2,2,2]
617
* [Partition an array into three parts with equal sum](partition_three_parts_equal_sum.py)
7-
* [Binary search on an Infinite array](binary_search_infinite_array.py)
18+
19+
Divide an array into three parts and sum all three parst must be same.
20+
* [Binary search on a finite array](binary_search_infinite_array.py)
21+
22+
Performing binary search on a finite array
23+
824
* [Largest Element](largest_element.py)
9-
* [Right Place](right_place.py)
25+
26+
Find out the largest element in an array
27+
1028
* [Rotation](rotation.py)
29+
30+
Rotate an array for given number such that the number goes to the end of array
31+
32+
input=[1,2,3,4,5] rotate around
33+
34+
output= [4,5,1,2,3]
1135
* [Find missing number](find_missing_numbers.py)
36+
37+
find missing number between smallest and largest number in array which are not present in array
38+
39+
input=[1,1,1,4]
40+
output=[2,3]
41+
1242
* [Three Largest Elements](three_largest_elements.py)
43+
44+
Find three largest numbers from an array
1345
* [Triplet Sum](triplet_sum.py)
14-
* [Max Product](max_product.py)
46+
47+
Find three elements of an array whose sum is eqaul to a given value
48+
1549
* [Moves to Zero](moves_zeros_to_end.py)
50+
51+
Given an array move all zeros in arrays to the end.
1652
* [Pivot Index](pivot_index.py)
53+
54+
Find the index of element whose right element when added give the same value.
1755
* [Intersection of Two Sorted Arrays](intersection_sorted_array.py)
56+
57+
find out the common elements from two arrays
1858
* [Max Triplet Sum](max_triplet_sum.py)
19-
* [Number of 1's in Sorted Array](number_of_1_in_sorted_array.py)
59+
60+
Find out maximium sum of any three elements for a given array
61+
2062
* [Square of Sorted Array](square_of_sorted_array.py)
21-
* [Max Consecutive 1's](max_consecutive_ones.py)
22-
* [Max Product Three Elements](max_product_three_elements.py)
23-
* [Kadane Algorithm](kadane_algorithm.py)
63+
64+
For a given array return an array that contains square of elements.
65+
2466
* [All Numbers Divisible](all_numbers_divisible.py)
25-
* [Duplicates](duplicates.py)
67+
68+
Find a number in the array such that all the elements in the array are divisible by it
69+
70+
71+
2672
* [Majority Element](majority_element.py)
73+
74+
Find an element in an array which has most occurences
2775
* [Find Sum](find_sum.py)
76+
77+
Find if sum of any elements in array is eqaul to a given number
2878
* [Quick Sort](quick_sort.py)
29-
* [Peak Element](peak_element.py)
79+
80+
### Implement Quick Sort algorithm
81+
82+
Quicksort Running Time:
83+
Quick sort average case is O(n log n)
84+
each level takes O(n) but splitting the data is O(log n)
85+
O(n) * O(log n) = O(n log n)
86+
Worse case is O(log n2)
87+
if pivot is smallest value, each level is O(n) and splitting the data is O(n)
88+
O(n) * O(n) = O(n2)
89+
3090
* [Union Sorted Array](union_sorted_array.py)
31-
* [Min Product](min_product.py)
91+
92+
Perform Union operations on two arrays
93+
3294
* [Sort By Parity](sort_by_parity.py)
95+
96+
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
3397
* [Duplicate](duplicate.py)
34-
* [Product of Array Except Self](product_of_array_except_self.py)
98+
99+
Find duplicate in an array of integers given that the integers are in random order and
100+
not necessarily each integer i is 0 <= i <= N where N = length of array
101+
* [Product of Array Except Self](product_of_array_except_self.py)
102+
103+
find the product of all elements in an array
104+
105+
* [Right Place](right_place.py)
106+
107+
Placing elements at right position in an array
108+
* [Max Product Three Elements](max_product_three_elements.py)
109+
110+
Find out highest sum of three numbers in an array
111+
* [Max Consecutive 1's](max_consecutive_ones.py)
112+
113+
Counts max number of one's in an array
114+
115+
* [Kadane Algorithm](kadane_algorithm.py)
116+
117+
Implementation of Kadane Algorithm
118+
* [Max Product](max_product.py)
119+
* [Number of 1's in Sorted Array](number_of_1_in_sorted_array.py)
120+
* [Duplicates](duplicates.py)
121+
* [Peak Element](peak_element.py)
122+
* [Min Product](min_product.py)

0 commit comments

Comments
 (0)