Sampleexam2 - ECE242 Data Structures and Algorithms Fall 2008 2nd Midterm Examination(120 Minutes closed book Name Question 1(10 2(20 3(25 4(10

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE242 Data Structures and Algorithms Fall 2008 2 nd Midterm Examination (120 Minutes, closed book) Name: ______________________ Student ID: ______________________ NOTE: Any questions on writing code must be answered in Java using data structures topics covered in lectures 1 - 26. Question Score 1 (10) 2 (20) 3 (25) 4 (10) 5 (15) 6 (20)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1. [10pt] Consider the below sequence of integers: 5 7 1 4 8 6 3 2 10 9 Show the steps involved when a merge sort algorithm is run on the above sequence of integers to sort them in ascending order (smallest value on the left). Note: You do not need to write any Java code, however, you need to show each step in the sorting process to receive full credit.
Background image of page 2
2. [20pt] a) [17pt] Consider two unsorted arrays, ArrayA and ArrayB that store Na and Nb non-repeating integers, respectively. Note that some of the integers in ArrayA could be present in ArrayB as well. Write a Java method mergeSortAB that merges ArrayA and ArrayB into a single sorted list, ArrayC , such that ArrayC contains integers that are in ArrayA or ArrayB but not in both. In other words, the ArrayC will
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/20/2010 for the course ENGINEERIN 242 211 taught by Professor Tessier during the Spring '10 term at UMass (Amherst).

Page1 / 18

Sampleexam2 - ECE242 Data Structures and Algorithms Fall 2008 2nd Midterm Examination(120 Minutes closed book Name Question 1(10 2(20 3(25 4(10

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online