Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit accc705

Browse files
committed
7/1
1 parent e275d70 commit accc705

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

README.org

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,39 +38,39 @@
3838
- 6th fibonacci number is 8
3939
*** Power.java (a to the power of b)
4040
- Evaluate a to the power of b, assuming both a and b are integers and b is non-negative.
41-
- power(2, 0) = 1
42-
- power(2, 3) = 8
43-
- power(0, 10) = 0
44-
- power(-2, 5) = -32
41+
- power(2, 0) = 1
42+
- power(2, 3) = 8
43+
- power(0, 10) = 0
44+
- power(-2, 5) = -32
4545
*** BinarySearch.java (Classical Binary Search)
4646
- Given a target integer T and an integer array A sorted in ascending order, find the index i such that A[i] == T or return -1 if there is no such index.
47-
- A = {1, 2, 3, 4, 5}, T = 3, return 2
48-
- A = {1, 2, 3, 4, 5}, T = 6, return -1
49-
- A = {1, 2, 2, 2, 3, 4}, T = 2, return 1 or 2 or 3
47+
- A = {1, 2, 3, 4, 5}, T = 3, return 2
48+
- A = {1, 2, 3, 4, 5}, T = 6, return -1
49+
- A = {1, 2, 2, 2, 3, 4}, T = 2, return 1 or 2 or 3
5050
*** FirstOccur.java (First Occurrence)
5151
- Given a target integer T and an integer array A sorted in ascending order, find the index of the first occurrence of T in A or return -1 if there is no such index.
52-
- A = {1, 2, 3}, T = 2, return 1
52+
- A = {1, 2, 3}, T = 2, return 1
5353
*** LastOccur.java (Last Occurrence)
5454
- Given a target integer T and an integer array A sorted in ascending order, find the index of the last occurrence of T in A or return -1 if there is no such index.
55-
- A = {1, 2, 3}, T = 2, return 1
56-
- A = {1, 2, 3}, T = 4, return -1
57-
- A = {1, 2, 2, 2, 3}, T = 2, return 3
55+
- A = {1, 2, 3}, T = 2, return 1
56+
- A = {1, 2, 3}, T = 4, return -1
57+
- A = {1, 2, 2, 2, 3}, T = 2, return 3
5858
*** Closest.java (Closest In Sorted Array)
5959
- Given a target integer T and an integer array A sorted in ascending order, find the index i in A such that A[i] is closest to T.
60-
- A = {1, 2, 3}, T = 2, return 1
61-
- A = {1, 4, 6}, T = 3, return 1
62-
- A = {1, 4, 6}, T = 5, return 1 or 2
63-
- A = {1, 3, 3, 4}, T = 2, return 0 or 1 or 2
60+
- A = {1, 2, 3}, T = 2, return 1
61+
- A = {1, 4, 6}, T = 3, return 1
62+
- A = {1, 4, 6}, T = 5, return 1 or 2
63+
- A = {1, 3, 3, 4}, T = 2, return 0 or 1 or 2
6464
*** KClosest.java (K Closest In Sorted Array)
6565
- Given a target integer T, a non-negative integer K and an integer array A sorted in ascending order, find the K closest numbers to T in A.
66-
- A = {1, 2, 3}, T = 2, K = 3, return {2, 1, 3} or {2, 3, 1}
66+
- A = {1, 2, 3}, T = 2, K = 3, return {2, 1, 3} or {2, 3, 1}
6767
*** UnknownSizeBinarySearch.java (Search In Unknown Sized Sorted Array)
6868
- Given a integer dictionary A of unknown size, where the numbers in the dictionary are sorted in ascending order, determine if a given target integer T is in the dictionary. Return the index of T in A, return -1 if T is not in A.
69-
- A = {1, 2, 5, 9, ......}, T = 5, return 2
70-
- A = {1, 2, 5, 9, 12, ......}, T = 7, return -1
69+
- A = {1, 2, 5, 9, ......}, T = 5, return 2
70+
- A = {1, 2, 5, 9, 12, ......}, T = 7, return -1
7171
*** SearchInSortedMatrix.java (Search In Sorted Matrix I)
7272
- Given a 2D matrix that contains integers only, which each row is sorted in an ascending order. The first element of next row is larger than (or equal to) the last element of previous row.
7373
- Given a target number, returning the position that the target locates within the matrix. If the target number does not exist in the matrix, return {-1, -1}.
74-
- matrix = { {1, 2, 3}, {4, 5, 7}, {8, 9, 10} }
75-
- target = 7, return {1, 2}
76-
- target = 6, return {-1, -1} to represent the target number does not exist in the matrix.
74+
- matrix = { {1, 2, 3}, {4, 5, 7}, {8, 9, 10} }
75+
- target = 7, return {1, 2}
76+
- target = 6, return {-1, -1} to represent the target number does not exist in the matrix.

0 commit comments

Comments
 (0)