Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/david-kariuki/dsa-java-practice1
Data Structures and Algorithms Practice 1 using java.
https://github.com/david-kariuki/dsa-java-practice1
algorithms data-structures dsa dsa-algorithm dsa-learning-series
Last synced: 3 months ago
JSON representation
Data Structures and Algorithms Practice 1 using java.
- Host: GitHub
- URL: https://github.com/david-kariuki/dsa-java-practice1
- Owner: david-kariuki
- License: mit
- Created: 2022-07-14T09:37:13.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-17T21:52:31.000Z (over 2 years ago)
- Last Synced: 2024-05-01T18:18:35.942Z (9 months ago)
- Topics: algorithms, data-structures, dsa, dsa-algorithm, dsa-learning-series
- Language: Java
- Homepage:
- Size: 109 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# DSAJavaPractice1
**Hello There**,
This is a repository to practice Data Structures and Algorithms using Java.| # | Topics Covered | Test Code
|-|-|-|
| 1.| Binary Search | Present |
| 2. |||
| 3. |||
| 4. |||
| 5. |||
||||
| A. BINARY SEARCH |
|-|| # | EXAMPLE CASE | TIME COMPLEXITY | PROBLEM STATEMENTS |
|-|-|-|-|
| 1. | Find The Index of a Target. | O(log(N)) | Given a sorted array of integers and an integer called target, find the element that equals the target and return its index. |
| 2. | Find the Boundary. | O(log(N)) | Find integer's index | An array of boolean values is divided into two sections: the left section consists of all false, and the right section consists of all true. Find the boundary of the right section, i.e. the index of the first true element. If there is no true element, return -1. |
| 3. | Find Element Not Smaller Than Target. | O(log(N)) | Given an array of integers sorted in increasing order and a target, find the index of the first element in the array that is larger or equal to the target. Assume that it is guaranteed to find a satisfying number. |
| 4. | Find First Occurrence. | O(log(N)) | Given a sorted array of integers and a target integer, find the first occurrence of the target and return its index. Return *-1* if the target is not in the array. |
| 5. | Square Root. | O(log(N)) | Given an integer, find its square root without using the built-in square root function. Only return the integer part (truncate the decimals). |
| 6. | Find Minimum in Rotated Sorted Array. | O(log(N)) | A sorted array was rotated at an unknown pivot. For example, * [10, 20, 30, 40, 50] * becomes * [30, 40, 50, 10, 20] *. Find the index of the minimum element in this array.
| 7. | The Peak of a Mountain Array| O(log(N)) | A mountain array is defined as an array that:
1. Has at least 3 elements.
2. Has an element with the largest value called the “peak”, at an index k. The array elements monotonically increase from the first element to A[k], and then monotonically decreases from A[k + 1] to the last element of the array. Thus creating a “mountain” of numbers.
Find the index of the peak element. Assume there are no duplicates. |
|||||