Programming > QUESTIONS & ANSWERS > Rutgers University PYTHON: Unit Four Assignment Two. MySearches.py (All)

Rutgers University PYTHON: Unit Four Assignment Two. MySearches.py

Document Content and Description Below

Unit Four Assignment Two ###### Read rands.txt, covert from strings to integers and then sort of the data. Have a list of sorted integers with a Len of 10,000 ###### Create a library called mySearc... hes.py thats has two functions bsearch & lsearch ###### bsearch is a function how many lookups were performed during the search before it returns its value ###### lsearch is a function that accepts an integer and a list, conducts a linear search thru the list and returns the index of the number in the list if the number is found and a -1 if the number is not found. ###### ....The function reports how many lookups were performed during the search before it returns its value def bsearch (x,nums): item = 0 low = 0 high = len(nums)-1 c = 0 while low <= high: #while loop for a range to search mid = (low + high)//2 #midpoint for guess item = nums[mid] [Show More]

Last updated: 2 years ago

Preview 1 out of 2 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$5.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

112
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 24, 2023

Number of pages

2

Written in

Seller


seller-icon
CourseWorks,Inc

Member since 3 years

9 Documents Sold

Reviews Received
2
0
0
0
0
Additional information

This document has been written for:

Uploaded

Mar 24, 2023

Downloads

 0

Views

 112

Document Keyword Tags

More From CourseWorks,Inc

View all CourseWorks,Inc's documents »

$5.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·