CS 2110 Midterm: CS 211 Cornell 2006 Fall t2 Examst2solcs211sp02

17 views12 pages
31 Jan 2019
Course
Professor

Document Summary

There are 8 questions on 11 numbered pages. Check now that you have all the pages. Use the back of the pages for workspace. The exam is closed book and closed notes. Page 1 of 11: (15 points) write a recursive binary search method to nd an object v in a sorted array a of comparables. The procedure should return true if object v is found in the array, and false if it is not found. //lo and hi are end points of the search interval in the array public static boolean binarysearch (comparable[] a, int lo, int hi, t v) { Page 2 of 11: (10 points) one advantage of quicksort is that it sorts in place. Manually perform quicksort on the following array of integers (sort in increasing order), using the. Rst element of each subarray as the pivot. In the spaces provided show the values in the array as quicksort proceeds down each level.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents