Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Average Number of comparisons in a Sequential Search

807589Jul 21 2008 — edited Jul 21 2008
I have a programming assignment due that performs a sequential search on an array of integers. I have it finding values based on user prompts. It either finds the number and gives its position or a message saying it is not in the list. It also gives the max and min values. Here is where I am drawing a blank...I am supposed to also show the number of comparisons the search routine did based on the return value, but I can't think of how it should work conceptually. Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2008
Added on Jul 21 2008
8 comments
208 views