Jump to content

Binary Search


kaveman50

Recommended Posts

Does anyone know how to do (or at least help me get started on) a binary search? I have to create a list of 25 names in alphebetical order.  Create a binary search program that searches for an input name.  Tell the user whether or not the name was found.

 

 

The names i'll use will be.

 

$arr=array('Allen', 'Brad', 'Chris', 'Drake', 'Eugene',' Frank', 'Greg', 'Hank', 'Ingrid', 'Jim', 'Kraig', 'Lee', 'Molly', 'Nathan', 'Otis', 'Peter', 'Quame', 'Rolland', 'Sean', 'Tiffany', 'Utopia', 'Venus', 'Walley', 'Xephinorgi', 'Yullanda', 'Zeus');

Link to comment
https://forums.phpfreaks.com/topic/184095-binary-search/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.