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: 1 year ago

Preview 1 out of 2 pages

Reviews( 0 )

$5.00

Add to cart

Instant download

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

OR

GET ASSIGNMENT HELP
67
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 1 year

8 Documents Sold


Additional information

This document has been written for:

Uploaded

Mar 24, 2023

Downloads

 0

Views

 67

Document Keyword Tags

More From CourseWorks,Inc

View all CourseWorks,Inc's documents »

Recommended For You

What is Browsegrades

In Browsegrades, 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 © Browsegrades · High quality services·