Browse Source

update array questions

Froilan Miranda 5 years ago
parent
commit
0a1dcaf2fd
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      Arrays.md

+ 3
- 3
Arrays.md View File

@@ -1,8 +1,8 @@
1 1
 # Array Questions
2
-*How to merge sorted array? (this could be a follow up to sorting an array)*
2
+**How to merge sorted array? (this could be a follow up to sorting an array)**
3 3
 Given two sorted integer arrays A and B, merge B into A as one sorted array. You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m and n respectively.
4 4
 
5
-*How to find minimum value in a rotated sorted array?*
5
+**How to find minimum value in a rotated sorted array?**
6 6
 Suppose a sorted array is rotated at some pivot unknown to you beforehand.
7 7
 
8 8
 (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
@@ -12,6 +12,6 @@ Find the minimum element.
12 12
 You may assume no duplicate exists in the array. One follow-up question of this question is What if duplicates are allowed? Would this affect the run-time complexity? How and why?
13 13
 
14 14
 
15
-*Given an array of of size n and a number k, find all elements that appear more than n/k times?*
15
+**Given an array of of size n and a number k, find all elements that appear more than n/k times?**
16 16
 You are given an array of size n, find all elements in array that appear more than n/k times. For example, if the input arrays is {3, 1, 2, 2, 1, 2, 3, 3} and k is 4, then the output should be [2, 3]. Note that size of array is 8 (or n = 8), so we need to find all elements that appear more than 2 (or 8/4) times. There are two elements that appear more than two times, 2 and 3.
17 17