项目作者: Rapter1990

项目描述 :
Binary Search Example
高级语言: Java
项目地址: git://github.com/Rapter1990/Binary-Search-Example.git
创建时间: 2020-05-02T09:59:38Z
项目社区:https://github.com/Rapter1990/Binary-Search-Example

开源协议:

下载


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







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