100% found this document useful (1 vote)
176 views4 pages

Latihan "Flowchart Dan Pseudocode Program Pencarian Binary Search"

The document provides a pseudocode and flowchart for a binary search program. The pseudocode declares variables including arrays to store names, student IDs, and grades. It then uses a while loop to iterate from low to high indexes, calculates the mid-point on each iteration, and compares the search value to the mid-point value, adjusting the low or high index as needed. It returns either the index if found or a message if not found.

Uploaded by

Hidayatullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
176 views4 pages

Latihan "Flowchart Dan Pseudocode Program Pencarian Binary Search"

The document provides a pseudocode and flowchart for a binary search program. The pseudocode declares variables including arrays to store names, student IDs, and grades. It then uses a while loop to iterate from low to high indexes, calculates the mid-point on each iteration, and compares the search value to the mid-point value, adjusting the low or high index as needed. It returns either the index if found or a message if not found.

Uploaded by

Hidayatullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

LATIHAN

“Flowchart dan Pseudocode Program Pencarian Binary Search”

HIDAYATULLAH
09011182025024
SK3B

ALGORITMA PEMROGRAMAN II
PSEUDOCODE
Program Binery_search;
{*Program pencarian Binery*}
Var {*Deklarasi*}
nama = ['Nana','Rudi','Dea','Ihsan','Tiara']
nim = ['13507701','13507702','13507703','13507704','13507705']
no_nilai = [64,75,84,77,66]
int low = 0
int mid;
indeks = -1;
Begin {*Deskripsi*}
while(low<=high) then
mid = (low+high)/2
if no_nilai[mid] = find then
index = mid
elif no_nilai[mid] < find then
low = mid + 1
else
high = mid – 1
if index = -1 then
WRITE “Data Tidak Ditemukan!”
else
WRITE “Data Ditemukan!” then
PRINT index(),no_nilai(),nama(),nim().
Stop
FLOWCHART
PROGRAM

You might also like