Data Structures and Algorithms Winter Semester

Size: px
Start display at page:

Download "Data Structures and Algorithms Winter Semester"

Transcription

1 Page 0 German University in Cairo December 26, 2015 Media Engineering and Technology Faculty Prof. Dr. Slim Abdennadher Dr. Wael Abouelsadaat Data Structures and Algorithms Winter Semester Final Exam Bar Code Instructions: Read carefully before proceeding. 1) Please tick your major Major MET IET Mechatronics BI 2) Duration of the exam: 3 hours (180 minutes). 3) No books or other aids are permitted for this test. 4) This exam booklet contains 15 pages, including this one. Three extra sheets of scratch paper are attached and have to be kept attached. Note that if one or more pages are missing, you will lose their points. Thus, you must check that your exam booklet is complete. 5) Write your solutions in the space provided. If you need more space, write on the back of the sheet containing the problem or on the three extra sheets and make an arrow indicating that. Scratch sheets will not be graded unless an arrow on the problem page indicates that the solution extends to the scratch sheets. 6) When you are told that time is up, stop working on the test. Good Luck! Don t write anything below ;-) Exercise Possible Marks Final Marks

2 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 1 Exercise 1 ( =12 Marks) a) Which sorting algorithm does run fastest when the data is already almost sorted? Choose only one. Justify your answer. 1. Bubble Sort 2. Selection Sort 3. Insertion Sort Insertion Sort, as it will only shift the first i elements when it encounters an item that is out of place. In case of almost sorted arrays, there are not many items that are out of place. b) What does the following postfix expression evaluate to? (Note: % is the modulus operator, not a percentage symbol) Do not transform it to infix notation. Justify your answer by using the appropriate data structure * % / 8 Using Stacks or BTrees (By drawing the steps of the solution) c) Draw all possible binary trees that have the following preorder traversal. Preorder: A B C A A A / / \ \ B B C B / / C C A A \ / B B \ \ C C

3 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 2 d) What is the smallest number of nodes that can be found in a binary search tree tree of height 4 (Note: root is at level zero)? Justify your answer by drawing the tree. 5 Nodes. For example: 0 \ 1 \ 2 \ 3 \ 4 e) Draw a binary tree consisting of 3 nodes such that the preorder and inorder traversals are the same. A \ B \ C f) Draw all possible binary search trees for three keys 1, 2, and / / 2 1 / \ / \ \ \ 2 3 \ / 3 2

4 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 3 Exercise 2 (10 Marks) Write an external method processqueue that simulates a manufacturing line. The method is given a queue of assembly items and an array of stacks. The method should continuously dequeue items from the queue until it is empty. After dequeing an item from the queue, it inspects the dequeued item to determine which stack it will go to. If a target stack is full, the method should enqueue the item back into the queue until the stack has a space again. The definition of class item (that will be inserted in the queue and stacks) is given below. public class AssemblyItem{ public int TargetStack; Stack ADT public class Stack { public Stack(int s); public void push(object k); public Object pop(); public int size(); public boolean isempty(); public boolean isfull(); Queue ADT public class Queue { public Queue(int s); public void enqueue(object k); public Object dequeue(); public int size(); public boolean isempty(); public boolean isfull();

5 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 4 The definition of the method is given below public class AssemblyLine{ public void processqueue( Queue queue, Stack[] StackArr ){ while(!queue.isempty()){ AssemblyItem item =(AssemblyItem) queue.dequeue(); int target = item.targetstack; if(stackarr[target].isfull()) queue.enqueue(item); else stackarr[target].push(item);

6 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 5 Exercise 3 (15 Marks) Write a method called deletetwosmallest that takes a singly linked list and deletes the two nodes that are next to each other in the list and have the smallest combined sum. After this deletion, a node with the smallest combined sum should be inserted at the end of the list. For example, if we have the following list: 1 -> 4 -> -10 -> 6 -> -5 the smallest combined sum of consecutive nodes is -6 which corresponds to = -6. So, after this operation the list would be: 1 -> 6 -> -5 -> -6 For full credit, your solution should NOT use the keyword new. Note: Remember to account for the cases where there are less than 2 elements in the list and when there are exactly two elements in the list. You are only allowed to use the following classes. You should not assume that there are any methods in these classes. public class Node { int data; Node next; public class SinglyLinkedList { Node First; public void deletetwosmallest() { p u b l i c c l a s s N o d e L i s t S o l u t i o n { p u b l i c v oid d e l e t e T w o S m a l l e s t ( ) { / / check l i s t has l e s s t h a n two e l e m e n t s i f ( f i r s t == n u l l f i r s t. n e x t == n u l l ) r e t u r n ; / / check l i s t has e x a c t l y two e l e m e n t s i f ( f i r s t. n e x t. n e x t == n u l l ) { f i r s t. d a t a = f i r s t. d a t a + f i r s t. n e x t. d a t a ; f i r s t. n e x t = n u l l ; r e t u r n ; / / s e a r c h f o r t h e min sum Node c u r r e n t = f i r s t ; Node p r e v i o u s = f i r s t ; Node b e f o r e S m a l l e s t = f i r s t ; i n t mindiff = f i r s t. d a t a + f i r s t. n e x t. d a t a ; w h i l e ( c u r r e n t. n e x t!= n u l l ) { i f ( c u r r e n t. d a t a + c u r r e n t. n e x t. d a t a < mindiff ) {

7 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 6 b e f o r e S m a l l e s t = p r e v i o u s ; mindiff = c u r r e n t. d a t a + c u r r e n t. n e x t. d a t a ; p r e v i o u s = c u r r e n t ; c u r r e n t = c u r r e n t. n e x t ; i f ( b e f o r e S m a l l e s t == f i r s t ) { f i r s t = f i r s t. n e x t ; e l s e { b e f o r e S m a l l e s t. n e x t = b e f o r e S m a l l e s t. n e x t. n e x t ; / / s h i f t i n g t h e d a t a of Nodes and s e t t i n g t h e l a s t node t o m i n D i f f e r e n b e f o r e S m a l l e s t = b e f o r e S m a l l e s t. n e x t ; w h i l e ( b e f o r e S m a l l e s t. n e x t!= n u l l ) { b e f o r e S m a l l e s t. d a t a = b e f o r e S m a l l e s t. n e x t. d a t a ; b e f o r e S m a l l e s t = b e f o r e S m a l l e s t. n e x t ; b e f o r e S m a l l e s t. d a t a = mindiff ; / / Another S o l u t i o n p u b l i c v oid d e l e t e T w o S m a l l e s t 2 ( ) { / / check l i s t has l e s s t h a n two e l e m e n t s i f ( f i r s t == n u l l f i r s t. n e x t == n u l l ) r e t u r n ; / / check l i s t has e x a c t l y two e l e m e n t s i f ( f i r s t. n e x t. n e x t == n u l l ) { f i r s t. d a t a += ( f i r s t. n e x t. d a t a ) ; f i r s t. n e x t = n u l l ; r e t u r n ; / / i n i t i a l i z e v a r i a b l e s i n t smallestsum = f i r s t. d a t a + f i r s t. n e x t. d a t a ; i n t s m a l l e s t I n d e x = 0 ; i n t c u r I n d e x = 0 ; Node c = f i r s t ; / / s e a r c h f o r min sum w h i l e ( c. n e x t!= n u l l ) { i n t cursum =c. d a t a + c. n e x t. d a t a ; i f ( cursum < smallestsum ) { smallestsum = cursum ; s m a l l e s t I n d e x = c u r I n d e x ; c = c. n e x t ; c u r I n d e x ++; / / loop t o c o r r e c t p o s i t i o n c u r I n d e x = 0 ; c = f i r s t ; w h i l e ( c u r I n d e x < s m a l l e s t I n d e x 1) { c = c. n e x t ;

8 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 7 c u r I n d e x ++; / / d e l e t e e l e m e n t s and r e u s e one of nodes Node i n s e r t L a s t = c. n e x t ; i f ( c == f i r s t ) f i r s t = f i r s t. n e x t. n e x t ; e l s e c. n e x t = c. n e x t. n e x t. n e x t ; i n s e r t L a s t. d a t a = smallestsum ; i n s e r t L a s t. n e x t = n u l l ; / / i n s e r t l a s t c = f i r s t ; w h i l e ( c. n e x t!= n u l l ) c = c. n e x t ; c. n e x t = i n s e r t L a s t ;

9 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 8 Exercise 4 Given the following tree and assume the root is at level 0 (5+8=13 Marks) 14 / \ / \ 7 11 / \ / \ / \ / / a) Circle all the true statements about the tree above: 1. The tree is a binary tree. 2. The tree is a binary search tree. 3. The tree is balanced. 4. The tree has a height of The node 30 is at depth 2. The correct statements are 1, 3 and 5. b) For the above tree, Label the following tree traversals as preorder, inorder, postorder, or invalid. (Invalid signifies that one or more sequences are improper traversals of the tree.) PreOrder Invalid InOrder PostOrder

10 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 9 Exercise 5 (4+10=14 Marks) A search tree data structure is similar to a binary search tree except that it keeps two values and three references in a node. The values are called left value and right value. The children are called left, middle and right. The invariants for this data structure are children to the left are smaller than the left value in the node. children in the middle are between the left value and the right value in the node. children to the right are greater than the right value in the node. Following is an example of a tree: a) Write the definition of class Link (aka Node) that could be used with the above description. b) Write a recursive search method that takes an integer as a target parameter and returns the node the target exists in or null. Specify the best case time complexity and the worst case time complexity given a nonempty tree. p u b l i c c l a s s Node { i n t v1 ; i n t v2 ; Node l e f t ; Node middle ; Node r i g h t ; p u b l i c Node ( i n t v1, i n t v2 ) { t h i s. v1 = v1 ; t h i s. v2 = v2 ; c l a s s Tree { Node r o o t ; p u b l i c Tree ( ) { r o o t = n u l l ; p u b l i c Node s e a r c h ( i n t v ) {

11 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 10 r e t u r n s e a r c h ( r o o t, v ) ; p u b l i c Node s e a r c h ( Node n, i n t v ) { i f ( n == n u l l ) r e t u r n n u l l ; e l s e i f ( n. v1 == v n. v2 == v ) r e t u r n n ; e l s e i f ( v > n. v2 ) r e t u r n s e a r c h ( n. r i g h t, v ) ; e l s e i f ( v < n. v1 ) r e t u r n s e a r c h ( n. l e f t, v ) ; e l s e r e t u r n s e a r c h ( n. middle, v ) ; / / b e s t c a s e i s O( 1 ) / / w o r s t c a s e i s O( n )

12 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 11 Exercise 6 Assume the following keys: ( =16 Marks) 28, 47, 20, 36, 23, 25, 19, 22, 7, 54 have been inserted in that same sequence order (28 first, 54 last) in a hash table of size 11. Fill in the hash table with the above values using each of the following collision handling strategies. Assume the hash function used is: a) Linear Probing f(key) = key%11 b) Quadratic Probing c) Chaining

13 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 12 d) Double hashing using the secondary hash function: g(key) = key%7 If the secondary function fails (collision happens), linear probing is used with the first hash function.

14 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 13

15 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 14 Exercise 7 This question is very popular on programming interviews. (10 Marks) Given an array of integers, you would like to print the elements and the count of their duplications in O(n) if we assume a uniform distribution of the integers, no collision occurs. For example, if the array consists of [11,14,11,5,12,14,11,30,5,5,12,5] the algorithm should output the following, assuming we are using a hashtable of size 10, and the hash function is : 30 occurs 1 time(s) 11 occurs 3 time(s) 12 occurs 2 time(s) 14 occurs 2 times(s) 5 occurs 4 time(s) f(key) = key%10 Write in Java the algorithm to perform this operation using Hashtables to ensure an O(n) time complexity. Hint: You can use two hashtables. Consider this interface of the Hashtable: public class Hashtable{ int [] array; int size; public Hashtable (int s){ array = new int[s]; size = s; void put (int key, int value){ // maps the specified key to the specified value in this hashtable void remove (int key){ // removes the key (and its corresponding value) from this hashtable. //This method does nothing if the key is not in the hashtable. int get (int key){ //returns the value to which the specified key is mapped. int hashcode (int key){ //returns the hashcode of the specified key using the function key%tablesize. boolean contains(int value) { // tests if some key maps into the specified value in this hashtable. //This method return true if and only if some key maps to the value argument //in this hashtable, false otherwise.

16 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 15 public void duplicatescount(int [] a){ p u b l i c c l a s s Q7 { p u b l i c s t a t i c v oid d u p l i c a t e s C o u n t ( i n t [ ] a ) { H a s h t a b l e numbers = new H a s h t a b l e ( a. l e n g t h ) ; H a s h t a b l e o c c u r r e n c e s = new H a s h t a b l e ( a. l e n g t h ) ; f o r ( i n t i = 0 ; i < a. l e n g t h ; i ++) { i n t key = numbers. hashcode ( a [ i ] ) ; i n t c o u n t = o c c u r r e n c e s. g e t ( key ) ; o c c u r r e n c e s. p u t ( key, c o u n t + 1 ) ; numbers. p u t ( key, a [ i ] ) ; f o r ( i n t i = 0 ; i < numbers. s i z e ; i ++) { i f ( o c c u r r e n c e s. a r r a y [ i ] > 0) System. o u t. p r i n t l n ( numbers. a r r a y [ i ] + " o c c u r s " + o c c u r r e n c e s. a r r a y [ i ] + " time ( s ) " ) ;

17 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 16 Scratch paper

18 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 17 Scratch paper

19 Data Structures and Algorithms, Final Exam, December 26, 2015 Page 18 Scratch paper

CSEN202: Introduction to Computer Programming Spring Semester 2014 Final Exam

CSEN202: Introduction to Computer Programming Spring Semester 2014 Final Exam Page 0 German University in Cairo June 14, 2014 Media Engineering and Technology Faculty Prof. Dr. Slim Abdennadher CSEN202: Introduction to Computer Programming Spring Semester 2014 Final Exam Bar Code

More information

INF2220: algorithms and data structures Series 1

INF2220: algorithms and data structures Series 1 Universitetet i Oslo Institutt for Informatikk I. Yu, D. Karabeg INF2220: algorithms and data structures Series 1 Topic Function growth & estimation of running time, trees (Exercises with hints for solution)

More information

Introduction to Computing II (ITI 1121) FINAL EXAMINATION

Introduction to Computing II (ITI 1121) FINAL EXAMINATION Université d Ottawa Faculté de génie École de science informatique et de génie électrique University of Ottawa Faculty of engineering School of Electrical Engineering and Computer Science Introduction

More information

Insert Sorted List Insert as the Last element (the First element?) Delete Chaining. 2 Slide courtesy of Dr. Sang-Eon Park

Insert Sorted List Insert as the Last element (the First element?) Delete Chaining. 2 Slide courtesy of Dr. Sang-Eon Park 1617 Preview Data Structure Review COSC COSC Data Structure Review Linked Lists Stacks Queues Linked Lists Singly Linked List Doubly Linked List Typical Functions s Hash Functions Collision Resolution

More information

CMSC 132, Object-Oriented Programming II Summer Lecture 12

CMSC 132, Object-Oriented Programming II Summer Lecture 12 CMSC 132, Object-Oriented Programming II Summer 2016 Lecturer: Anwar Mamat Lecture 12 Disclaimer: These notes may be distributed outside this class only with the permission of the Instructor. 12.1 Trees

More information

Solution suggestions for examination of Logic, Algorithms and Data Structures,

Solution suggestions for examination of Logic, Algorithms and Data Structures, Department of VT12 Software Engineering and Managment DIT725 (TIG023) Göteborg University, Chalmers 24/5-12 Solution suggestions for examination of Logic, Algorithms and Data Structures, Date : April 26,

More information

Introduction to Computing II (ITI 1121) FINAL EXAMINATION

Introduction to Computing II (ITI 1121) FINAL EXAMINATION Université d Ottawa Faculté de génie École de science informatique et de génie électrique University of Ottawa Faculty of engineering School of Electrical Engineering and Computer Science Identification

More information

Advanced Implementations of Tables: Balanced Search Trees and Hashing

Advanced Implementations of Tables: Balanced Search Trees and Hashing Advanced Implementations of Tables: Balanced Search Trees and Hashing Balanced Search Trees Binary search tree operations such as insert, delete, retrieve, etc. depend on the length of the path to the

More information

Introduction to Computing II (ITI1121) FINAL EXAMINATION

Introduction to Computing II (ITI1121) FINAL EXAMINATION Université d Ottawa Faculté de génie École de science informatique et de génie électrique University of Ottawa Faculty of engineering School of Electrical Engineering and Computer Science Identification

More information

Solutions. Prelim 2[Solutions]

Solutions. Prelim 2[Solutions] Prelim [Solutions]. Short Answer [ pts] (a) [ pts] A traversal of an expression tree produces the string + + 3. i. What kind of traversal is it? Preorder; the operator is printed before the operands. ii.

More information

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016 University of Toronto Department of Electrical and Computer Engineering Final Examination ECE 345 Algorithms and Data Structures Fall 2016 Print your first name, last name, UTORid, and student number neatly

More information

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts) Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We

More information

CSCE 750 Final Exam Answer Key Wednesday December 7, 2005

CSCE 750 Final Exam Answer Key Wednesday December 7, 2005 CSCE 750 Final Exam Answer Key Wednesday December 7, 2005 Do all problems. Put your answers on blank paper or in a test booklet. There are 00 points total in the exam. You have 80 minutes. Please note

More information

1 Trees. Listing 1: Node with two child reference. public class ptwochildnode { protected Object data ; protected ptwochildnode l e f t, r i g h t ;

1 Trees. Listing 1: Node with two child reference. public class ptwochildnode { protected Object data ; protected ptwochildnode l e f t, r i g h t ; 1 Trees The next major set of data structures belongs to what s called Trees. They are called that, because if you try to visualize the structure, it kind of looks like a tree (root, branches, and leafs).

More information

University of New Mexico Department of Computer Science. Midterm Examination. CS 361 Data Structures and Algorithms Spring, 2003

University of New Mexico Department of Computer Science. Midterm Examination. CS 361 Data Structures and Algorithms Spring, 2003 University of New Mexico Department of Computer Science Midterm Examination CS 361 Data Structures and Algorithms Spring, 2003 Name: Email: Print your name and email, neatly in the space provided above;

More information

Prelim 2[Solutions] Solutions. 1. Short Answer [18 pts]

Prelim 2[Solutions] Solutions. 1. Short Answer [18 pts] Prelim [Solutions]. Short Answer [8 pts] (a) [3 pts] In a model/view/controller, Swing is likely to be part of (there may be more than one): i. the model ii. the view iii. the controller The view and the

More information

Queues. Principles of Computer Science II. Basic features of Queues

Queues. Principles of Computer Science II. Basic features of Queues Queues Principles of Computer Science II Abstract Data Types Ioannis Chatzigiannakis Sapienza University of Rome Lecture 9 Queue is also an abstract data type or a linear data structure, in which the first

More information

Binary Search Trees. Motivation

Binary Search Trees. Motivation Binary Search Trees Motivation Searching for a particular record in an unordered list takes O(n), too slow for large lists (databases) If the list is ordered, can use an array implementation and use binary

More information

MIDTERM Fundamental Algorithms, Spring 2008, Professor Yap March 10, 2008

MIDTERM Fundamental Algorithms, Spring 2008, Professor Yap March 10, 2008 INSTRUCTIONS: MIDTERM Fundamental Algorithms, Spring 2008, Professor Yap March 10, 2008 0. This is a closed book exam, with one 8 x11 (2-sided) cheat sheet. 1. Please answer ALL questions (there is ONE

More information

Lecture 4: Stacks and Queues

Lecture 4: Stacks and Queues Reading materials Goodrich, Tamassia, Goldwasser (6th), chapter 6 OpenDSA (https://opendsa-server.cs.vt.edu/odsa/books/everything/html/): chapter 9.8-13 Contents 1 Stacks ADT 2 1.1 Example: CharStack ADT

More information

Algorithms Exam TIN093 /DIT602

Algorithms Exam TIN093 /DIT602 Algorithms Exam TIN093 /DIT602 Course: Algorithms Course code: TIN 093, TIN 092 (CTH), DIT 602 (GU) Date, time: 21st October 2017, 14:00 18:00 Building: SBM Responsible teacher: Peter Damaschke, Tel. 5405

More information

Motivation. Dictionaries. Direct Addressing. CSE 680 Prof. Roger Crawfis

Motivation. Dictionaries. Direct Addressing. CSE 680 Prof. Roger Crawfis Motivation Introduction to Algorithms Hash Tables CSE 680 Prof. Roger Crawfis Arrays provide an indirect way to access a set. Many times we need an association between two sets, or a set of keys and associated

More information

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2006

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2006 University of New Mexico Department of Computer Science Final Examination CS 561 Data Structures and Algorithms Fall, 2006 Name: Email: Print your name and email, neatly in the space provided above; print

More information

CS-141 Exam 2 Review October 19, 2016 Presented by the RIT Computer Science Community

CS-141 Exam 2 Review October 19, 2016 Presented by the RIT Computer Science Community CS-141 Exam 2 Review October 19, 2016 Presented by the RIT Computer Science Community http://csc.cs.rit.edu Linked Lists 1. You are given the linked list: 1 2 3. You may assume that each node has one field

More information

Introduction to Computing II (ITI 1121) MIDTERM EXAMINATION

Introduction to Computing II (ITI 1121) MIDTERM EXAMINATION Université d Ottawa Faculté de génie École de science informatique et de génie électrique University of Ottawa Faculty of Engineering School of Electrical Engineering and Computer Science Identification

More information

CSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: Oct 26. Homework #2. ( Due: Nov 8 )

CSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: Oct 26. Homework #2. ( Due: Nov 8 ) CSE548, AMS542: Analysis of Algorithms, Fall 2017 Date: Oct 26 Homework #2 ( Due: Nov 8 ) Task 1. [ 80 Points ] Average Case Analysis of Median-of-3 Quicksort Consider the median-of-3 quicksort algorithm

More information

Design and Analysis of Algorithms March 12, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 1

Design and Analysis of Algorithms March 12, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 1 Design and Analysis of Algorithms March 12, 2015 Massachusetts Institute of Technology 6.046J/18.410J Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 1 Quiz 1 Do not open this quiz booklet until

More information

Math 51 First Exam October 19, 2017

Math 51 First Exam October 19, 2017 Math 5 First Exam October 9, 27 Name: SUNet ID: ID #: Complete the following problems. In order to receive full credit, please show all of your work and justify your answers. You do not need to simplify

More information

/463 Algorithms - Fall 2013 Solution to Assignment 4

/463 Algorithms - Fall 2013 Solution to Assignment 4 600.363/463 Algorithms - Fall 2013 Solution to Assignment 4 (30+20 points) I (10 points) This problem brings in an extra constraint on the optimal binary search tree - for every node v, the number of nodes

More information

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page. 6.045J/18.400J: Automata, Computability and Complexity March 30, 2005 Quiz 2 Prof. Nancy Lynch Please write your name in the upper corner of each page. Problem Score 1 2 3 4 5 6 Total Q2-1 Problem 1: True

More information

CMPSCI 311: Introduction to Algorithms Second Midterm Exam

CMPSCI 311: Introduction to Algorithms Second Midterm Exam CMPSCI 311: Introduction to Algorithms Second Midterm Exam April 11, 2018. Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more

More information

Outline Resource Introduction Usage Testing Exercises. Linked Lists COMP SCI / SFWR ENG 2S03. Department of Computing and Software McMaster University

Outline Resource Introduction Usage Testing Exercises. Linked Lists COMP SCI / SFWR ENG 2S03. Department of Computing and Software McMaster University COMP SCI / SFWR ENG 2S03 Department of Computing and Software McMaster University Week 10: November 7 - November 11 Outline 1 Resource 2 Introduction Nodes Illustration 3 Usage Accessing and Modifying

More information

Introduction to Algorithms March 10, 2010 Massachusetts Institute of Technology Spring 2010 Professors Piotr Indyk and David Karger Quiz 1

Introduction to Algorithms March 10, 2010 Massachusetts Institute of Technology Spring 2010 Professors Piotr Indyk and David Karger Quiz 1 Introduction to Algorithms March 10, 2010 Massachusetts Institute of Technology 6.006 Spring 2010 Professors Piotr Indyk and David Karger Quiz 1 Quiz 1 Do not open this quiz booklet until directed to do

More information

Searching Algorithms. CSE21 Winter 2017, Day 3 (B00), Day 2 (A00) January 13, 2017

Searching Algorithms. CSE21 Winter 2017, Day 3 (B00), Day 2 (A00) January 13, 2017 Searching Algorithms CSE21 Winter 2017, Day 3 (B00), Day 2 (A00) January 13, 2017 Selection Sort (MinSort) Pseudocode Rosen page 203, exercises 41-42 procedure selection sort(a 1, a 2,..., a n : real numbers

More information

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes )

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes ) CSE613: Parallel Programming, Spring 2012 Date: May 11 Final Exam ( 11:15 AM 1:45 PM : 150 Minutes ) This exam will account for either 10% or 20% of your overall grade depending on your relative performance

More information

Name: Student ID: Instructions:

Name: Student ID: Instructions: Instructions: Name: CSE 322 Autumn 2001: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions, 20 points each. Time: 50 minutes 1. Write your name and student

More information

CS361 Homework #3 Solutions

CS361 Homework #3 Solutions CS6 Homework # Solutions. Suppose I have a hash table with 5 locations. I would like to know how many items I can store in it before it becomes fairly likely that I have a collision, i.e., that two items

More information

Math 51 Midterm 1 July 6, 2016

Math 51 Midterm 1 July 6, 2016 Math 51 Midterm 1 July 6, 2016 Name: SUID#: Circle your section: Section 01 Section 02 (1:30-2:50PM) (3:00-4:20PM) Complete the following problems. In order to receive full credit, please show all of your

More information

Math 110 (Fall 2018) Midterm II (Monday October 29, 12:10-1:00)

Math 110 (Fall 2018) Midterm II (Monday October 29, 12:10-1:00) Math 110 (Fall 2018) Midterm II (Monday October 29, 12:10-1:00) Name: SID: Please write clearly and legibly. Justify your answers. Partial credits may be given to Problems 2, 3, 4, and 5. The last sheet

More information

Priority queues implemented via heaps

Priority queues implemented via heaps Priority queues implemented via heaps Comp Sci 1575 Data s Outline 1 2 3 Outline 1 2 3 Priority queue: most important first Recall: queue is FIFO A normal queue data structure will not implement a priority

More information

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ;

import java. u t i l. ;... Scanner sc = new Scanner ( System. in ) ; CPSC 490 Input Input will always arrive on stdin. You may assume input is well-formed with respect to the problem specification; inappropriate input (e.g. text where a number was specified, number out

More information

Array-based Hashtables

Array-based Hashtables Array-based Hashtables For simplicity, we will assume that we only insert numeric keys into the hashtable hash(x) = x % B; where B is the number of 5 Implementation class Hashtable { int [B]; bool occupied[b];

More information

MATH 1553 PRACTICE MIDTERM 1 (VERSION A)

MATH 1553 PRACTICE MIDTERM 1 (VERSION A) MATH 1553 PRACTICE MIDTERM 1 (VERSION A) Name Section 1 2 3 4 5 Total Please read all instructions carefully before beginning. Each problem is worth 1 points. The maximum score on this exam is 5 points.

More information

CSE 355 Test 2, Fall 2016

CSE 355 Test 2, Fall 2016 CSE 355 Test 2, Fall 2016 28 October 2016, 8:35-9:25 a.m., LSA 191 Last Name SAMPLE ASU ID 1357924680 First Name(s) Ima Regrading of Midterms If you believe that your grade has not been added up correctly,

More information

Stacks. Definitions Operations Implementation (Arrays and Linked Lists) Applications (system stack, expression evaluation) Data Structures 1 Stacks

Stacks. Definitions Operations Implementation (Arrays and Linked Lists) Applications (system stack, expression evaluation) Data Structures 1 Stacks Stacks Definitions Operations Implementation (Arrays and Linked Lists) Applications (system stack, expression evaluation) Data Structures 1 Stacks Stacks: Definitions and Operations A LIFO list: Last In,

More information

EXAM. CS331 Compiler Design Spring Please read all instructions, including these, carefully

EXAM. CS331 Compiler Design Spring Please read all instructions, including these, carefully EXAM Please read all instructions, including these, carefully There are 7 questions on the exam, with multiple parts. You have 3 hours to work on the exam. The exam is open book, open notes. Please write

More information

Introduction to Hashtables

Introduction to Hashtables Introduction to HashTables Boise State University March 5th 2015 Hash Tables: What Problem Do They Solve What Problem Do They Solve? Why not use arrays for everything? 1 Arrays can be very wasteful: Example

More information

ECS 20: Discrete Mathematics for Computer Science UC Davis Phillip Rogaway June 12, Final Exam

ECS 20: Discrete Mathematics for Computer Science UC Davis Phillip Rogaway June 12, Final Exam ECS 20: Discrete Mathematics for Computer Science Handout F UC Davis Phillip Rogaway June 12, 2000 Final Exam Instructions: Read the questions carefully; maybe I m not asking what you assume me to be asking!

More information

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question.

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question. Data 8 Fall 2017 Foundations of Data Science Final INSTRUCTIONS You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question. The exam is closed

More information

Fall 2016 Test 1 with Solutions

Fall 2016 Test 1 with Solutions CS3510 Design & Analysis of Algorithms Fall 16 Section B Fall 2016 Test 1 with Solutions Instructor: Richard Peng In class, Friday, Sep 9, 2016 Do not open this quiz booklet until you are directed to do

More information

Quiz 2 out of 50 points

Quiz 2 out of 50 points Quiz 2 out of 50 points Print your name on the line below. Do not turn this page over until told by the staff to do so. This quiz is closed-book. However, you may utilize during the quiz one two-sided

More information

CMSC 132, Object-Oriented Programming II Summer Lecture 6:

CMSC 132, Object-Oriented Programming II Summer Lecture 6: CMSC 132, Object-Oriented Programming II Summer 2016 Lecturer: Anwar Mamat Lecture 6: Disclaimer: These notes may be distributed outside this class only with the permission of the Instructor. 6.1 Singly

More information

NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):

NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt): CS 170 First Midterm 26 Feb 2010 NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt): Instructions: This is a closed book, closed calculator,

More information

Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2

Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2 Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology 6.046J/18.410J Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2 Quiz 2 Do not open this quiz booklet until

More information

Element x is R-minimal in X if y X. R(y, x).

Element x is R-minimal in X if y X. R(y, x). CMSC 22100/32100: Programming Languages Final Exam M. Blume December 11, 2008 1. (Well-founded sets and induction principles) (a) State the mathematical induction principle and justify it informally. 1

More information

Functional Data Structures

Functional Data Structures Functional Data Structures with Isabelle/HOL Tobias Nipkow Fakultät für Informatik Technische Universität München 2017-2-3 1 Part II Functional Data Structures 2 Chapter 1 Binary Trees 3 1 Binary Trees

More information

University of Toronto MAT137Y1 Calculus! Test 2 1 December 2017 Time: 110 minutes

University of Toronto MAT137Y1 Calculus! Test 2 1 December 2017 Time: 110 minutes University of Toronto MAT137Y1 Calculus! Test 2 1 December 2017 Time: 110 minutes Please complete this cover page with ALL CAPITAL LETTERS. Last name......................................................................................

More information

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You: CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 1 8:00-10:00pm, 24 September Your First Name: SIGN Your Name: Your Last Name: Your Exam Room: Name of Person Sitting on Your Left: Name

More information

Tribhuvan University Institute of Science and Technology 2067

Tribhuvan University Institute of Science and Technology 2067 11CSc. MTH. -2067 Tribhuvan University Institute of Science and Technology 2067 Bachelor Level/First Year/ Second Semester/ Science Full Marks: 80 Computer Science and Information Technology Pass Marks:

More information

CSE332: Data Structures & Parallelism Lecture 2: Algorithm Analysis. Ruth Anderson Winter 2019

CSE332: Data Structures & Parallelism Lecture 2: Algorithm Analysis. Ruth Anderson Winter 2019 CSE332: Data Structures & Parallelism Lecture 2: Algorithm Analysis Ruth Anderson Winter 2019 Today Algorithm Analysis What do we care about? How to compare two algorithms Analyzing Code Asymptotic Analysis

More information

RYERSON UNIVERSITY DEPARTMENT OF MATHEMATICS

RYERSON UNIVERSITY DEPARTMENT OF MATHEMATICS RYERSON UNIVERSITY DEPARTMENT OF MATHEMATICS MTH 110 Final Exam December 6, 2008 Total marks: 100 Time allowed: 3 Hours. NAME (Print): STUDENT #: SIGNATURE: Circle your Lab Section: Section 1 Section 2

More information

EENG/INFE 212 Stacks

EENG/INFE 212 Stacks EENG/INFE 212 Stacks A stack is an ordered collection of items into which new items may be inserted and from which items may be deleted at one end called the top of the stack. A stack is a dynamic constantly

More information

MATH UN1201, Section 3 (11:40am 12:55pm) - Midterm 1 February 14, 2018 (75 minutes)

MATH UN1201, Section 3 (11:40am 12:55pm) - Midterm 1 February 14, 2018 (75 minutes) Name: Instructor: Shrenik Shah MATH UN1201, Section 3 (11:40am 12:55pm) - Midterm 1 February 14, 2018 (75 minutes) This examination booklet contains 6 problems plus an additional extra credit problem.

More information

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions PRINT Your Name: Answer: Oski Bear SIGN Your Name: PRINT Your Student ID: CIRCLE your exam room: Dwinelle

More information

Divide-and-Conquer Algorithms Part Two

Divide-and-Conquer Algorithms Part Two Divide-and-Conquer Algorithms Part Two Recap from Last Time Divide-and-Conquer Algorithms A divide-and-conquer algorithm is one that works as follows: (Divide) Split the input apart into multiple smaller

More information

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2013

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2013 University of New Mexico Department of Computer Science Final Examination CS 561 Data Structures and Algorithms Fall, 2013 Name: Email: This exam lasts 2 hours. It is closed book and closed notes wing

More information

CS 170 Algorithms Spring 2009 David Wagner Final

CS 170 Algorithms Spring 2009 David Wagner Final CS 170 Algorithms Spring 2009 David Wagner Final PRINT your name:, (last) SIGN your name: (first) PRINT your Unix account login: Your TA s name: Name of the person sitting to your left: Name of the person

More information

Statistics 433 Practice Final Exam: Cover Sheet and Marking Sheet

Statistics 433 Practice Final Exam: Cover Sheet and Marking Sheet Statistics 433 Practice Final Exam: Cover Sheet and Marking Sheet YOUR NAME INSTRUCTIONS: No notes, no calculators, and no communications devices are permitted. Please keep all materials away from your

More information

Math 41 Final Exam December 9, 2013

Math 41 Final Exam December 9, 2013 Math 41 Final Exam December 9, 2013 Name: SUID#: Circle your section: Valentin Buciumas Jafar Jafarov Jesse Madnick Alexandra Musat Amy Pang 02 (1:15-2:05pm) 08 (10-10:50am) 03 (11-11:50am) 06 (9-9:50am)

More information

Computer Science. Questions for discussion Part II. Computer Science COMPUTER SCIENCE. Section 4.2.

Computer Science. Questions for discussion Part II. Computer Science COMPUTER SCIENCE. Section 4.2. COMPUTER SCIENCE S E D G E W I C K / W A Y N E PA R T I I : A L G O R I T H M S, T H E O R Y, A N D M A C H I N E S Computer Science Computer Science An Interdisciplinary Approach Section 4.2 ROBERT SEDGEWICK

More information

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam Version A December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

ITI Introduction to Computing II

ITI Introduction to Computing II (with contributions from R. Holte) School of Electrical Engineering and Computer Science University of Ottawa Version of January 9, 2019 Please don t print these lecture notes unless you really need to!

More information

Fundamental Algorithms

Fundamental Algorithms Fundamental Algorithms Chapter 5: Searching Michael Bader Winter 2014/15 Chapter 5: Searching, Winter 2014/15 1 Searching Definition (Search Problem) Input: a sequence or set A of n elements (objects)

More information

Amortized analysis. Amortized analysis

Amortized analysis. Amortized analysis In amortized analysis the goal is to bound the worst case time of a sequence of operations on a data-structure. If n operations take T (n) time (worst case), the amortized cost of an operation is T (n)/n.

More information

This exam is closed book and closed notes. (You will have access to a copy of the Table of Common Distributions given in the back of the text.

This exam is closed book and closed notes. (You will have access to a copy of the Table of Common Distributions given in the back of the text. TEST #1 STA 5326 September 25, 2014 Name: Please read the following directions. DO NOT TURN THE PAGE UNTIL INSTRUCTED TO DO SO Directions This exam is closed book and closed notes. (You will have access

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science ALGORITHMS FOR INFERENCE Fall 2014

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science ALGORITHMS FOR INFERENCE Fall 2014 MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.438 ALGORITHMS FOR INFERENCE Fall 2014 Quiz 2 Wednesday, December 10, 2014 7:00pm 10:00pm This is a closed

More information

Exam 1. March 12th, CS525 - Midterm Exam Solutions

Exam 1. March 12th, CS525 - Midterm Exam Solutions Name CWID Exam 1 March 12th, 2014 CS525 - Midterm Exam s Please leave this empty! 1 2 3 4 5 Sum Things that you are not allowed to use Personal notes Textbook Printed lecture notes Phone The exam is 90

More information

CS 311 Sample Final Examination

CS 311 Sample Final Examination Name: CS 311 Sample Final Examination Time: One hour and fifty minutes This is the (corrected) exam from Fall 2009. The real exam will not use the same questions! 8 December 2009 Instructions Attempt all

More information

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015 University of Florida EEL 3701 Summer 2015 Dr Eric M Schwartz Page 1/13 Exam 1 May the Schwartz be with you! Instructions: Turn off all cell phones and other noise making devices Show all work on the front

More information

Binary Search Trees. Lecture 29 Section Robb T. Koether. Hampden-Sydney College. Fri, Apr 8, 2016

Binary Search Trees. Lecture 29 Section Robb T. Koether. Hampden-Sydney College. Fri, Apr 8, 2016 Binary Search Trees Lecture 29 Section 19.2 Robb T. Koether Hampden-Sydney College Fri, Apr 8, 2016 Robb T. Koether (Hampden-Sydney College) Binary Search Trees Fri, Apr 8, 2016 1 / 40 1 Binary Search

More information

Math 141 Final Exam December 18, 2014

Math 141 Final Exam December 18, 2014 Math 141 Final Exam December 18, 2014 Name: Complete the following problems. In order to receive full credit, please provide rigorous proofs and show all of your work and justify your answers. Unless stated

More information

University of Connecticut Department of Mathematics

University of Connecticut Department of Mathematics University of Connecticut Department of Mathematics Math 1131 Sample Exam 2 Fall 2015 Name: Instructor Name: Section: TA Name: Discussion Section: This sample exam is just a guide to prepare for the actual

More information

MATH 1553, FALL 2018 SAMPLE MIDTERM 2: 3.5 THROUGH 4.4

MATH 1553, FALL 2018 SAMPLE MIDTERM 2: 3.5 THROUGH 4.4 MATH 553, FALL 28 SAMPLE MIDTERM 2: 3.5 THROUGH 4.4 Name GT Email @gatech.edu Write your section number here: Please read all instructions carefully before beginning. The maximum score on this exam is

More information

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion:

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion: German University in Cairo Media Engineering and Technology Prof. Dr. Slim Abdennadher Dr. Mohammed Abdel Megeed Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion:

More information

Tutorial Session 5. Discussion of Exercise 4, Preview on Exercise 5, Preparation for Midterm 1. Running Time Analysis, Asymptotic Complexity

Tutorial Session 5. Discussion of Exercise 4, Preview on Exercise 5, Preparation for Midterm 1. Running Time Analysis, Asymptotic Complexity Tutorial Session 5 Tuesday, 19 th of March 2019 Discussion of Exercise 4, Preview on Exercise 5, Preparation for Midterm 1 Running Time Analysis, Asymptotic Complexity 16.15 17.45 / 18.15 19.45 BIN 0.B.06

More information

1. For each statement, either state that it is True or else Give a Counterexample: (a) If a < b and c < d then a c < b d.

1. For each statement, either state that it is True or else Give a Counterexample: (a) If a < b and c < d then a c < b d. Name: Instructions. Show all work in the space provided. Indicate clearly if you continue on the back side, and write your name at the top of the scratch sheet if you will turn it in for grading. No books

More information

Please give details of your answer. A direct answer without explanation is not counted.

Please give details of your answer. A direct answer without explanation is not counted. Please give details of your answer. A direct answer without explanation is not counted. Your answers must be in English. Please carefully read problem statements. During the exam you are not allowed to

More information

Problem Set 4 Solutions

Problem Set 4 Solutions Introduction to Algorithms October 8, 2001 Massachusetts Institute of Technology 6.046J/18.410J Singapore-MIT Alliance SMA5503 Professors Erik Demaine, Lee Wee Sun, and Charles E. Leiserson Handout 18

More information

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion:

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion: German University in Cairo Media Engineering and Technology Prof. Dr. Slim Abdennadher Dr. Rimon Elias Dr. Hisham Othman Introduction to Computer Programming, Spring Term 2018 Practice Assignment 1 Discussion:

More information

Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You: CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 2 8:00-10:00pm, 31 October Your First Name: SIGN Your Name: Your Last Name: Your SID Number: Your Exam Room: Name of Person Sitting on

More information

- - - - - - - - - - - - - - - - - - DISCLAIMER - - - - - - - - - - - - - - - - - - General Information: This midterm is a sample midterm. This means: The sample midterm contains problems that are of similar,

More information

- - - - - - - - - - - - - - - - - - DISCLAIMER - - - - - - - - - - - - - - - - - - General Information: This is a midterm from a previous semester. This means: This midterm contains problems that are of

More information

A Simple Implementation Technique for Priority Search Queues

A Simple Implementation Technique for Priority Search Queues A Simple Implementation Technique for Priority Search Queues RALF HINZE Institute of Information and Computing Sciences Utrecht University Email: ralf@cs.uu.nl Homepage: http://www.cs.uu.nl/~ralf/ April,

More information

CPSC 320 (Intermediate Algorithm Design and Analysis). Summer Instructor: Dr. Lior Malka Final Examination, July 24th, 2009

CPSC 320 (Intermediate Algorithm Design and Analysis). Summer Instructor: Dr. Lior Malka Final Examination, July 24th, 2009 CPSC 320 (Intermediate Algorithm Design and Analysis). Summer 2009. Instructor: Dr. Lior Malka Final Examination, July 24th, 2009 Student ID: INSTRUCTIONS: There are 6 questions printed on pages 1 7. Exam

More information

CS 170 Algorithms Fall 2014 David Wagner MT2

CS 170 Algorithms Fall 2014 David Wagner MT2 CS 170 Algorithms Fall 2014 David Wagner MT2 PRINT your name:, (last) SIGN your name: (first) Your Student ID number: Your Unix account login: cs170- The room you are sitting in right now: Name of the

More information

CS 5321: Advanced Algorithms Amortized Analysis of Data Structures. Motivations. Motivation cont d

CS 5321: Advanced Algorithms Amortized Analysis of Data Structures. Motivations. Motivation cont d CS 5321: Advanced Algorithms Amortized Analysis of Data Structures Ali Ebnenasir Department of Computer Science Michigan Technological University Motivations Why amortized analysis and when? Suppose you

More information

Review &The hardest MC questions in media, waves, A guide for the perplexed

Review &The hardest MC questions in media, waves, A guide for the perplexed Review &The hardest MC questions in media, waves, A guide for the perplexed Grades online pp. I have been to the Grades online and A. Mine are up-to-date B. The quizzes are not up-to-date. C. My labs are

More information

FACULTY OF SCIENCE ACADEMY OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING OBJECT ORIENTED PROGRAMMING DATE 07/2014 SESSION 8:00-10:00

FACULTY OF SCIENCE ACADEMY OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING OBJECT ORIENTED PROGRAMMING DATE 07/2014 SESSION 8:00-10:00 FACULTY OF SCIENCE ACADEMY OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING MODULE CAMPUS CSC2A10 OBJECT ORIENTED PROGRAMMING AUCKLAND PARK CAMPUS (APK) EXAM JULY 2014 DATE 07/2014 SESSION 8:00-10:00 ASSESOR(S)

More information

University of Illinois ECE 313: Final Exam Fall 2014

University of Illinois ECE 313: Final Exam Fall 2014 University of Illinois ECE 313: Final Exam Fall 2014 Monday, December 15, 2014, 7:00 p.m. 10:00 p.m. Sect. B, names A-O, 1013 ECE, names P-Z, 1015 ECE; Section C, names A-L, 1015 ECE; all others 112 Gregory

More information