COMP 251 Autumn 2013 Homework 2 Solutions
Gheorghe Comanici and Prakash Panangaden
1. The students are either committed or uncommitted at any stage while a hospital either is available
or full. The al
Homework 1: Solutions
COMP 251 Autumn 2012
Instructor:Prakash Panangaden
1. Give an algorithm to nd the largest and the smallest number in an unordered set of n numbers. What
is the running time of yo
Mid-Term Exam 1 Solutions
COMP 251 Algorithms and Data Structures
Tues. Feb. 4, 2014
Prof. Michael Langer
1)
a)
GRADING SCHEME: 2 points total. We have 0.5 for inserting the 45 at the correct place. T
COMP 251 - Fall 2017 - Assignment 2
Due: 11:59pm Oct 13th
General rules: In solving these questions you may consult your book; You can discuss high level
ideas with each other, but each student must f
COMP 251 - Fall 2017 - Assignment 1
Due: 11:59pm Sept 22
General rules: In solving these questions you may consult your book;
You can discuss high level ideas with each other, but each student must
fi
Data
Structure
Time Complexity
Access
Array
Stack
Queue
SinglyLinked
List
DoublyLinked
List
Hash
Table
Binary
Search
Tree
RedBlack
Tree
AVL Tree
Average
Search Insertion Deletion
N/A
Sorting
Algorithm
COMP 251 Data Structures and Algorithms.
FALL 2016
Monday-Wednesday 14:30-16:00 ENGMC 204
Lectured by Prof. Claude Crpeau
Office: McConnell 110N, Phone: 398-4716
Summary :
Design and analysis of algor
Kruskals Algorithm
Prims Algorithm
Ford-Fulkerson
Needleman-Wunch
Dijkstras Algorithm
Bellman-Ford
Finds a minimum spanning tree (DOESNT
NEED TO BE A CONNECTED GRAPH)
Finds a minimum spanning tree (MU
Comp 251: Assignment 1
Answers must be returned online by February 4th (11:59pm), 2015.
Your solution must be returned electronically on MyCourse.
The only format accepted for written answers is PDF
Lecture 02017/01/05
Ofce Hours Tues/Thu 1-2pm
40% for 5 assignments, 15% for midterm, 45% for nal exam
Midterm March 9 (one crib sheet permitted, 2 pages), during class time ADAMS AUD
End of class Apr
Comp 251: Assignment 2
Answers must be returned online by February 20th (11:59pm), 2015.
Your solution must be returned electronically on MyCourse.
The only format accepted for written answers is PD
Comp 251: Assignment 3
Instructor: Jrme Waldisphl
Due on March 18th at 11h59
Your solution must be returned electronically on MyCourse.
The only format accepted for written answers is PDF. PDF files
COMP-251B
Data Structures and Algorithms
Faculty of Science Final Examination
Computer Science 308-251B Data Structures and Algorithms
Examiner: Prof. Claude Crpeau Associate Examiner: Lecturer Martin
Computer Science COMP-251B
Midterm, Feb 16, 2011, 16:05-17:25.
O P E N B O O K S / O P E N N O T E S
1)
a) Write a recursive algorithm such that the related time recurrence cannot be
solved with the M
Assignment 2
A decimal integer can be stored as a linear list of its digits. Write a Java class LargeInteger that will implement the
arithmetic operations of two decimal integers stored in this way.
T
Assignment 1
Write a program for a video store to keep track of its videos and customers. The program should
be able to perform the following operations:
1. Rent a video on a given day.
2. Return a vi
COMP 251A 2014, assignment 3
Due Wednesday Nov 12th 2014
[10%]
!
Note : It turns out that different domains for the xis yield very different solutions. So
lets explore that in details. You may choose
COMP 251A 2014, Assignment 4
Due Thursday December 4th 2014
[10%]
[15%]
[15%]
!
[20%] Problems 26-1: Escape problem
An n n grid is an undirected graph consisting of n rows and n columns of vertices, a
Exercises: Dijkstras algorithm
Questions
1. In breadth first search, each vertex has a visited field which is set to true before the vertex is
put in the queue. What happens if BFS instead sets the vi
COMP-251B
Data Structures and Algorithms
Faculty of Science
Final Examination
Computer Science COMP-251B
Data Structures and Algorithms
Examiner: Prof. Claude Crpeau
Associate Examiner: Prof. Clark Ve
COMP 251 - Fall 2017 - Assignment 5
Due: 11:59pm Dec 3rd
General rules: In solving these questions you may consult your book; You can discuss high level
ideas with each other, but each student must fi
COMP 251 Winter 2017
Professor Jerome Waldispuhl
Assignment 4 Solutions
1.
According to the graph above, the number of bit operations nearly doubles every
time a power of 2 is reached. In addition, th
COMP 251 Winter 2017
Professor Jerome Waldispuhl
Assignment 5 Solutions
1. In a sequence of n operations, there are exactly log2(n) + 1 exact powers of 2
(i.e.: 1, 2, 4, 8, , 22 . The total cost is de
COMP 251 Winter 2017
Professor Jerome Waldispuhl
Assignment 3 Solutions
3. P = array of length N, stores the index of the predecessor of X[k] in the longest
increasing subsequence ending at X[k].
M =
Comp 251: Assignment 1
Answers must be returned online by February 1st (11:59pm), 2017.
Your solution must be returned electronically on MyCourse.
Written answers and programming questions must be r
COMP 251 2016, Assignment 4, due
Monday December 5th 2016 23:59
1. Maximum Deadline
[10%]
[10%]
[5%]
[5%]
[10%]
2. Critical edges
3. Blood Bank
[10%]
[10%]
10
4. Escape Problem (26-1)
An n n grid is
COMP 251 Fall 2016, HW-3
Due Wednesday Nov 16th 2016, 23:59:59
[10%]
1) RBT-Sorting.
The input is a sequence of n integers with many duplications, such that the number
of distinct integers in the sequ
COMP 251 - Fall 2017 - Assignment 3
Due: 11:59pm Nov 3rd
General rules: In solving these questions you may consult your book; You can discuss high level
ideas with each other, but each student must fi
Comp 251: Assignment 3
Instructor: Jrme Waldisphl
Due on March 22th at 11h59
Your solution must be returned electronically on MyCourse.
Written answers and programming questions must be returned in
Comp 251: Assignment 5
Instructor: Jrme Waldisphl
Due on April 11th at 11h59
Your solution must be returned electronically on MyCourse.
The only format accepted for written answers are PDF or text f
Comp 251: Assignment 4
Instructor: Jrme Waldisphl
Due on April 8th at 11h59
Your solution must be returned electronically on MyCourse.
Written answers and programming questions must be returned in s
Comp 251: Assignment 2
Answers must be returned online by February 26th (11:59pm), 2017.
Your solution must be returned electronically on MyCourse.
Written answers and programming questions must be