docs: update the whole repository

* fix some bugs
* delete duplicate files
* format code
This commit is contained in:
yanglbme
2019-05-09 19:32:54 +08:00
parent 163db8521a
commit 29948363da
368 changed files with 4372 additions and 30841 deletions

View File

@ -7,17 +7,14 @@ import java.util.stream.Stream;
* Linear search is the easiest search algorithm
* It works with sorted and unsorted arrays (an binary search works only with sorted array)
* This algorithm just compares all elements of an array to find a value
*
* <p>
* Worst-case performance O(n)
* Best-case performance O(1)
* Average performance O(n)
* Worst-case space complexity
*
*
* @author Varun Upadhyay (https://github.com/varunu28)
* @author Podshivalov Nikita (https://github.com/nikitap492)
*
*
* @see BinarySearch
* @see SearchAlgorithm
*/
@ -33,7 +30,7 @@ public class LinearSearch implements SearchAlgorithm {
*/
@Override
public <T extends Comparable<T>> int find(T[] array, T value) {
for (int i = 0; i < array.length ; i++) {
for (int i = 0; i < array.length; i++) {
if (array[i].compareTo(value) == 0) {
return i;
}