-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearch.java
More file actions
31 lines (24 loc) · 863 Bytes
/
Search.java
File metadata and controls
31 lines (24 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
import java.util.Arrays;
public class Search {
public static void main(String args[]){
Scanner scanner1 = new Scanner(System.in);
String option;
System.out.println("Please choose the type of search you want to perform.");
String linear = "1. Linear";
String binary = "2. Binary";
System.out.println(linear);
System.out.println(binary);
option = scanner1.next();
//INSTANCE OF THE LINEAR SEARCH CLASS
if(option.equals("1")){
Linear_Search linear1 = new Linear_Search();
linear1.lineaSearch();
}
//INSTANCE OF THE BINARY SEARCH CLASS
if(option.equals("2")){
BinarySearch binarySearch = new BinarySearch();
binarySearch.binarySearch();
}
}
}