Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 25-07-07, 02:41 PM   #1 (permalink)
Member
 
Join Date: Jul 2007
Age: 26
Posts: 47
Thanks: 0
Thanked 1 Times in 1 Posts
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 2 Birbal is on a distinguished road
binary Search

hi frieds,

I am facing problem in Binary Search

my code is under following


int binarySearch(byte[] a, byte key)
{
int low=0;
int hi=a.length -1;
int mid=0;
while(low<=hi)
{
mid= (low+ hi)>>1;
final byte d= a[mid];
if (d==key)
return mid;
else if (d>key)
hi=mid-1;
else

low=++mid;
}
return -mid -1;
}




please check it and why it is not working,
if u have code , please give me.
Birbal is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search Engine Sites yathish Search Engine Optimization (SEO) 2 23-07-07 08:13 PM
What is binary search, traversal, hashing? pooja.22 ds. c , c++ Interview / Technical Questions 0 23-01-07 08:50 PM
How To Design A Search Engine Friendly Website vjsreevs Search Engine Optimization (SEO) 7 24-09-06 11:52 AM
INTERNET SESSION-3 (for newbies) wizkid NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING 0 22-07-06 01:59 PM
INTERNET SESSION-2(for newbies) wizkid NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING 0 21-07-06 03:22 PM


All times are GMT +6.5. The time now is 02:38 AM.





Search Engine Optimization by vBSEO 3.1.0