Linear Searching double Arrays
public class Main {
public static void main(String[] args) {
double[] x = { 92.3, 45.2, 6.8, -3.6, 10, 9000, -39 };
int i;
for (i = 0; i < x.length; i++){
if (x[i] == 9000){
break;
}
}
if (i == x.length)
System.out.println("Not found");
else
System.out.println("Found");
}
}
Output:
Found
Home
Java Book
Runnable examples
Java Book
Runnable examples
Algorithm:
- Binary search
- Binary Search Insert
- Recursive Binary Search Implementation in Java
- Linear Searching double Arrays
- Bubble sort
- Heap sort
- Merge sort
- Fast Merge Sort
- Fast Quick Sort
- Simple version of quick sort
- Quicksort for sorting arrays
- Quick Sort Implementation with median-of-three partitioning and cutoff for small arrays
- Quick sort with median-of-three partitioning
- Insert sort
- Insert Sort for objects
- Selection sort
- Shell sort
- Fibonacci
- Hanoi puzzle
- Table of fahrenheit and celsius temperatures
- Growable integer array
- Linked List class
- Binary Tree
- Tree with generic user object