Microsoft Windows Vista Home Premium with Service Pack 1: Windows Logo

Related Topics:

Anonymous Posted on Mar 08, 2009

Visual basic program for binary search technique

1 Answer

Anonymous

Level 3:

An expert who has achieved level 3 by getting 1000 points

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

Brigadier General:

An expert that has over 10,000 points.

  • Master 10,406 Answers
  • Posted on Sep 10, 2009
Anonymous
Master
Level 3:

An expert who has achieved level 3 by getting 1000 points

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

Brigadier General:

An expert that has over 10,000 points.

Joined: Apr 23, 2009
Answers
10406
Questions
1
Helped
2599334
Points
31058

This sounds like "homework".

A binary-search requires an "ordered" table of values.
Sort your values into the proper order.

LET TOP=1; * Point to first element in the table.
LET BOT=1000; * Point to the *LAST* item in the table.

LOOPHERE:

LET BINARY = 2;

LET MIDDLE=FLOOR((TOP+BOT)/BINARY);

IF VALUE(MIDDLE) = KEY THEN STOP;

IF KEY < VALUE(MIDDLE)
THEN TOP = MIDDLE;
ELSE BOTTOM = MIDDLE;

IF TOP = BOTTOM THEN STOP;

GOTO LOOPHERE;

END;

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

546 views

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

Sudeep Chatterjee
Sudeep Chatterjee

Level 3 Expert

3269 Answers

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3869 Answers

Brad Brown

Level 3 Expert

19190 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...