CPSC 112 Midterm: CS 112 Yale 14 Spring Exam2 Solution

26 views8 pages
31 Jan 2019
Course
Professor

Document Summary

Cis 110 spring 2014 introduction to computer programming. Check coversheet for name, recitation #, pennkey, and signature. (1 point total) 1. 1) (4 points) for each scenario below, choose whether it would be better to store the data in an array, an arraylist, or a linkedlist. Circle one answer for each scenario. (10 points total) (a) the data rarely changes, and the program should use the least amount of memory possible: array. Linkedlist (b) the amount of data will vary over time, but memory usage should always be minimal: array. Linkedlist (c) the order of the data is constantly changing: array. Linkedlist (d) the data is pennids of students, updated daily, and repeatedly searched using binary search: array. 1. 2) (2 points) which algorithm for sorting a large array of integers is the fastest? (a) insertion sort (b) merge sort (c) selection sort (d) bubble sort (e) they are all equally fast.

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