Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

binary search

 
ramesh kandukuri
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any method in any package available for
Binary search?
Thanks in advcance
Ramesh
 
Rehana Shaik
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
In java.util pacakage in collections you can find binary search
static int binarySearch(List list, Object key)
static int binarySearch(List list, Object key, Comparator c)
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Collections.binarySearch()
java.util.Arrays.binarySearch()
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic