Spring 2016 - Midterm Exam
When answering questions, please state any and all assumptions you are making.
1. (15 pts) For the following program fragments, give an an
OY 0L bihomfam
~ od- wind: h, \Mhomtak M 063 haw: 2R
._ e, Roch/3 m amnw m m Ska/cfw_+11 W cfw_a 3km
a MW 0? "0'
L. mocha Show w SQHS'FA, My 0% $9?ng CWQ
Ni uSSuM minHeqY) : W \hsiou PW< lug MsicQQchm/j
Wkacl 5L6) bfnoquQ W bask u?
* Program Title: D-Heaps
* Class: CSCI-3320, Fall 2016
* Assignment #2
public class DHeap cfw_
/d, The number of children each node has */
private int d;
private int heapSize;
private int heap;
* Created by emilybradley on 11/27/16.
public class menue cfw_
private void menue() cfw_
public static int mainMenue()cfw_
Scanner input = new Scanner(System.in);
int choice = 0;
CSCI3320 Written Assignment #3
(Due: 5 PM, June. 28, 2016)
P1 (5 pts) Show the result of inserting a key 30 in to the B-tree below:
P2 (5 pts) Find the optimal parameters, M (branching factor), L (number of recorders in a leaf), of
the B-tree f
CSCI3320 Programming Assignment #1
(Due: 11:59 PM, June 13, 2016)
Problems Description: Note that the maximum contiguous subsequence sum algorithms in the
text do not give any indication of the actual sequence. In this assignment, you will modify these
Spring 2016 Midterm Exam II
When answering questions, please state any and all assumptions you are making. 1. (10 pts) Answer the following question
CSCI 3320 Programming Assignment 2 (Due date: 11:59 PM, Mon., June 28, 2016)
Implementation of D-Heaps
The binary heap discussed in class is a special case of a d-heap with d=2. Write the
1. deleteMin (and percolate down)
CSCI3320 Written Assignment #2
(Due: Noon, Mar. 2, 2016)
Find the number of inversions for the following input:
By swapping 18 and 1, how many inversions will be removed and how many inversions
will be added?
CSCI3320 Written Assignment #1
(Due: Noon, Feb. 8, 2016)
(5 pts) Exercise 1.5
(10 pts) Proof by Induction (You must provide Induction Proof).
o Exercise 1.11: (a) only (Assume F0=1, F1=1, and Fk+1= Fk + Fk-1)
o Exercise 1.12: (b) only
. P _ a D
W wt: Jim) 1?
Prinkn Job QM WLL :l I"j_%_:j
Wu, thbcchom 1
OPanhmQT ~ inse
Fm 'erse. OPQIUJHWS, W. amid Uge. a? dim dimchmu .
wom 1mm 9% ,zwugxm m 604) "Fm mm, on) cfw_WMMM
- EST, any W 0 0mm) w1ma+,ut+eu~m.
3&1: Hm a onA-ak mm 41m