/
/
/
/
Adapted from Kevin T. Manley
CSE 593

package server;
/ Represents a customer's "reserved item" (e.g. Flight, Car, or Room).
/ Note: if a customer reserves more than one item of the same kind, this is
/ stored as a single instance of ReservedIte
School of Computer Science, McGill University
COMP512 Distributed Systems
Assignment 1; Due on 20October 10am
Please be aware that students have to work individually on this assignment.
Exercise 1: Minis (20 Points)
1. (5 Points) Software clocks
Assume
Author: Muhammad Yousuf Ahmad
Date: September 20, 2015
COMP 512: Distributed Systems
School of Computer Science
McGill University
A Distributed System in Java using Web Services.
Adapted from CSE 593, University of Washington.
=
Project Structure:
+ buil
School of Computer Science, McGill University
COMP512 Distributed Systems, Fall 2015
Project Part 1: Distributing an Application
Due date: October 5/6
NOTENOTENOTE: This project deliverable has a maximum of 100 points. If you do a
solid implementation
McGill University
COMP206
School of Computer Science
December 2012
Final Examination
Introduction to Software Systems
COMP206
December 7, 2012 at 14:00 17:00
Examiner:
Joseph Vybihal
Student Name:
Assoc Examiner:
Mike Langer
McGill ID:
INSTRUCTIONS:
Thi
McGill University
COMP206
School of Computer Science
December 2013
Final Examination
Introduction to Software Systems
COMP206
December 5, 2013 at 9:00 12:00
Examiner:
Joseph Vybihal
Assoc Examiner:
Student Name:
McGill ID:
INSTRUCTIONS:
This is a CLOSED
Exercises 21 : lower bounds on sorting, bucket sort,
independence (modified April 6 dropped 2 questions formerly Q3,Q4)
Questions
1. Give a lower bound on the best case scenario for any comparisonbased sorting algorithm, as a
function of n. That is, you
Exercises 22 : data compression
Questions
1) One natural approach to finding an optimal prefix code, suggested in the lecture, is as follows:
given a sample space S and a probability function p(), partition S into two sets (events) whose
probabilities are
Exercises 20 : randomized select
Questions
1. Suppose you choose a pivot randomly for a list of size n. What is the probability that the
resulting two lists l1 and l2 will both have size at most 9 n /10 ?
2. In the proof of the linear time expected perfor
Exercises 16: closest pair of points
Questions
1. In the closest pair of points algorithm, one of the subproblems is to find the closest pair of
points with one point in the left half and one point in the right half. If we use brute force for
that problem
Exercises: shortest paths revisited (BellmanFord,
FloydWarshall)
Questions
1. In the lecture, we saw that we didt need to use O(n^2) space for Bellman Ford by keeping track
of the previous node in a shortest path. Could we apply similar idea to the prob
Exercises 17: Karatsuba multiplication, Master method
Questions
1. In Karatsuba multiplication, when you do the multiplication (x1 + x0)*(y1 + y0), the two values you
are multiplying might be n/2 + 1 digits each, rather than n/2 digits, since the addition
Exercises 19 : average case
Questions
1.
Here are a few questions about amortized analysis.
a) In Java, the ArrayList class is an implementation of a list class that uses an underlying array.
One nice property of a Java ArrayList is that the user doesnt n
Exercises 18 : quicksort and select (deterministic)
Questions
1. In the lecture, when I presented linear time selection algorithm, I partitioned the list into two
lists whose elements were less than the pivot (l1) and greater than or equal to the pivot (l
Exercises: subset sum and knapsack (modified
March 7)
Questions
1. Why is knapsack a more general problem than subset sum. (Give a formal answer.)
2. Consider an instance of subset sum in which w1 = 1, w2 = 4, w3 = 3, w4=6 and W = 8.
the table of opt(i, w
Exercises: Network Flows 1
Questions
1. On the left below is flow network (G,c) with s at the top left corner and t at the lower right. On
the right is a flow f. Verify for yourself that the flow satisfies the conservation conditions. Draw
the residual gr
Exercises: Bipartite Graphs
Questions
For all questions, assume we are talking about undirected graphs.
1) Suppose you have a connected graph and you do depth first search (DFS) from an arbitrarily chosen
vertex. This defines a DFS tree. There may be edge
Exercises: segmented least squares
Questions
1. In the lecture I claimed there were 2^cfw_N1 ways to partition the sequence cfw_1, 2, , N into k
disjoint sequences (or segments) where, by definition, the segments contain consecutive
numbers (or a single
Exercises: interval scheduling [Last updated March 3]
Questions
1. Consider the greedy algorithm (#3, see lecture) for interval scheduling which picks the compatible
interval that finishes as soon as possible. We saw in class that this gives an optimal so
Exercises: Network Flows 2
Questions
1.
Consider a flow network G,
and a flow f, where I have written f(e)/ c(e) at each edge. (This is a notation that is commonly
used to show both the flow and capacities on a single graph).
Draw the residual graph G_f a
STUDENT NAME: \
STUDENT ID. NUMBER: \
FACULTY OF SCIENCE
FINAL EXAM
COMPUTER SCIENCE COMP25] A
COURSE TITLE: DATA STRUCTURES AND ALGORITHMS
Examiner: Godfried T oussaint Date: December 7, 2004
Associate Examiner: Mike Hallet Time: 14:00 17:00
Instruction
MidTerm 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. This
makes the tree unbalanced. The first rotation gets