https://github.com/rapter1990/binary-search-example
Binary Search Example
https://github.com/rapter1990/binary-search-example
binarysearch java
Last synced: 10 months ago
JSON representation
Binary Search Example
- Host: GitHub
- URL: https://github.com/rapter1990/binary-search-example
- Owner: Rapter1990
- Created: 2020-05-02T09:59:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T13:18:20.000Z (over 5 years ago)
- Last Synced: 2025-01-20T22:53:07.197Z (11 months ago)
- Topics: binarysearch, java
- Language: Java
- Homepage:
- Size: 1.06 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Binary Search Example
- This method is used to search the provided list for the specified object using the binary search algorithm. The list must be sorted into ascending order according to the specified natural number, prior to making the method call. If the list is not sorted, the results are undefined
- This java example shows how to search an element of Java ArrayList using binarySearch method of Collections class. binarySearch method usesbinary search algorithm to search an element.
The objective of Program
- The program firstly reads a long file containing above 90000 objects and set each object into the City and implement search process in terms of name of city, substring name of city and one character.
Files contaning in this repository
- src
- files
- cities.txt
- output.txt
- main
- Main.java
- model
- City.java
- util
- BinarySearch.java
- ProcessMethod.java
- ReadFile.java
- ShowResult.java
- WriteFile.java
- files
Explaining an inforamtion of each file
Files Names
Information
cities.txt
Contaning the infomation of city (its weight,its name and lastly its country)
output.txt
Show the result of search process in terms of name of city, substring name of city and one character with being sensitive for lowercase and uppercase
Main.java
Handle with all project files to run the program
City.java
Defining it as a POJO
BinarySearch.java
Implementing search algorithm for name of city, substring name of city and one character
ProcessMethod.java
Managing all search algorithm via defined function
ReadFile.java
Reading cities.txt and assign each variable to City Object
ShowResult.java
Showing the search result
WriteFile.java
Writing all the search result into the output.txt