🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Francis Sat, 23 Dec 2000 10:35
Pascal programing problem
#49490
Author: Francis
Date: Sat, 23 Dec 2000 10:35
14 lines
1553 bytes
Please help me to finish the classwork ! Thank you !!!
write a recursive function to perform the binary search on a sorted array
table. The declaration of the function is as follows:
uses variables table: array [1..1000] of char;
FUNCTION binary_search(target: char; lower,upper: integer):integer;
where table is a global variable, target is the value we want to find;
lower and upper are the lower and upper limits of searching range.
The function will return the position of the array element if target is
found.If the target is not found, it will return 0.
Merry Christmas !
Billy


Re: Pascal programing problem
#49491
Author: Disciplinary Meowbot
Date: Sat, 23 Dec 2000 10:59
33 lines
2765 bytes
Francis <wlng0620@ctimail3.com> wrote:
> Please help me to finish the classwork ! Thank you !!!

(From where does the idea that news.software.nntp might be helpful to
beginning programmers come?)

I wish news.announce.newsusers was in working order.  If it was, by
now you hopefully would have had a chance to see this:

    Usenet is not a resource for homework or class assignments. A
    common new user reaction to learning of all these people out there
    holding discussions is to view them as a great resource for
    gathering information for reports and papers.  Trouble is, after
    seeing a few hundred such requests, most people get tired of them,
    and won't reply anyway. Certainly not in the expected or hoped-for
    numbers. Posting student questionnaires automatically brands you a
    "newbie" and does not usually garner much more than a tiny number
    of replies.  Further, some of those replies are likely to be
    incorrect.

You can (and really, really should) read the rest of this article at
<URL:http://www.faqs.org/faqs/usenet/primer/part1/>.

> write a recursive function to perform the binary search on a sorted
> array table.

You will almost certainly find the answer to this in your textbook.
It is a very common assignment for introductory programming courses.
If the dog ate your textbook, visit <URL:http://www.google.com> and
ask it about recursion and binary searches.  This problem doesn't
really need recursion, so make sure that you steal^H^H^Hudy k0dez that
match your assignment.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads