CSC 263 H1
Worth: 2%
Problem Set # 1
Winter 2015
Due: By 5:59pm on Tuesday 13 January
Remember to write your full name and student number prominently on your submission.
Please read and understand the
CSC 263 H1
Problem Set # 5
Worth: 2%
Winter 2015
Due: By 5:59pm on Tuesday 3 March
Remember to write your full name and student number prominently on your submission.
Please read and understand the po
CSC373S
Selected solutions for Problem Set 1
Spring, 2008
Due: Wed, January 30, beginning of lecture
1. This question concerns Dijkstras shortest (i.e. least cost) paths algorithm. (See
section 4.4).
CSC 263 H1
Worth: 12%
Assignment # 1
Winter 2015
Due: By 5:59pm on Tuesday 10 February
Remember to write the full name and student number of every group member prominently on
your submission.
Please r
=
CSC 263
Tutorial Exercise for Week 1
=
Consider the following algorithm to find the maximum element in a list.
FIND-MAX(L):
max = -oo # minus infinity
for k = L.length-1,.,1,0:
if L[k] > max:
max =
Winter 2015
MOCK MidtermSolutions
CSC 263 H1
Question 1. [9 marks]
Consider the following Python code which simulates rolling a pair of dice and counting the number
of rolls until we reach n pairs. We
CSC263 Week 5
Larry Zhang
http:/goo.gl/forms/S9yie3597B
Announcements
PS3 marks out, class average 81.3%
Assignment 1 due next week.
Response to feedbacks - tutorials
We spent too much time on working
Introduction to Algorithms, Third Edition
Supplemental Content
This page contains supplemental content for Introduction to Algorithms, Third Edition.
Bug reports:
A list of known bugs and errata may b
=
=
CSC 263
Lecture Summary for Week 7
Fall 2014
=
=
READING: Chapter 17.
SELF-TEST: Exercises 17.1-2.
-Amortized Analysis
- Often, we perform _sequences_ of operations on data structures and
time
com
CSC263 Week 4
Larry Zhang
http:/goo.gl/forms/S9yie3597B
Announcements
PS2 marks available on MarkUS (aver. 87%)
Re-marking requests accepted until Feb 10th
Tutorials
Tutorial questions will be poste
Chapter 11: Hash Tables.
We have possible values of actual values, and hash table only stores the actual values to store, so
that possible values are not needed,
Totally ordered set: we must be able t
CSC 263 H1
Worth: 2%
Problem Set # 7
Fall 2014
Due: By 9:59pm on Wednesday 12 November
Remember to write your full name and student number prominently on your submission.
Please read and understand th
CSC 263 H1
Problem Set # 4Sample Solutions
Fall 2014
Data: In addition to S.root and S.nil, dictionary S gets a new eld S.min equal to the element in
S with the minimum keyset S.min = S.nil when S is
CSC 263 H1
Worth: 2%
Problem Set # 6
Fall 2014
Due: By 9:59pm on Wednesday 5 November
Remember to write your full name and student number prominently on your submission.
Please read and understand the
CSC263 Week 3
Announcements
PS1 marks out, average: 90%
re-marking requests can be submitted on
MarkUS.
Assignment 1 is out, due Feb 10
more challenging than PS! Start early!
work in groups of up
Winter 2015
MOCK Midterm
CSC 263 H1
Question 1. [9 marks]
Consider the following Python code which simulates rolling a pair of dice and counting the number
of rolls until we reach n pairs. We are inte
CSC263 Week 8
Larry Zhang
http:/goo.gl/forms/S9yie3597B
Announcements (strike related)
Lectures go as normal
Tutorial this week
everyone go to BA3012 (T8, F12, F2, F3)
Problem sets / Assignments a
Ranking
In a set or a dictionary:
Rank of key k is i iff k is the ith smallest key.
Example: if s stores these keys 42, 55, 61, then:
s.rank(42) returns 1
s.rank(55) returns 2
s.rank(61) returns 3
s.r
Introduction
c
8
b
7
d
2
9
4
4
a
i
11
e
14
7
8
10
h
f
6
1
g
2
These are computers and costs of direct connections. What is a
cheapest way to network them?
1 / 25
(Edge-)Weighted Graph
Many useful grap
Introduction
Today we begin studying how to calculate the total time of a
sequence of operations as a whole.
(As opposed to each operation individually.)
Why and when we care:
you have an algorithm th
Random, Average, Probability
Some algorithms have terrible worst-case times, but:
on random input, they are fast on average
or, they contain randomizing steps, and are fast on average
We will study th
Union-Find
Union-nd stores a bunch of disjoint sets. Supports:
from a member, nd its owning set
union two sets
Basic idea:
Each set is a directed tree. Members are vertices.
Use root to stand for the
Fibonacci (Min-)Heap
a forest of heap-order trees (parent priority child priority)
roots in circular doubly-linked list
pointer to minimum-priority root
siblings in circular doubly-linked list;
parent
Hash Tables
Assume you can map keys to natural numbers from 0 to m 1.
Call that function h.
Use an array A of length m.
Put key k in A[h(k)]. Except. . .
What if h maps several different keys to the s
Shufing An Array
for i from 1 to n 1: (where n = A.length)
swap A[i] with A[random(i, n)]
1 / 10
Shufing An Array
for i from 1 to n 1: (where n = A.length)
swap A[i] with A[random(i, n)]
Every nal per
Motivation
Old storage organization:
CPU
RAM
disk
slow
cache
RAM
slow
Modern storage organization:
CPU
Data stored in the slow device. But read/write is per block.
Want to read/write fewer blocks.
Wan
UNIVERSITY OF TORONTO W
Faculty of Arts and Science ' -
DECEMBER 2011 EXAMINATIONS 6,959
080 263/265H1F 9
Instructors: Faith Ellen and Toni Pitassi
Duration: 3 hours
Aids allowed: One 8% X 11 sheet of
26 February 2015
CSC 263 H1
Midterm Test
Duration: 110 minutes
Aids Allowed: One single-sided hand written 8.5"11" aid sheet.
Student Number:
Last (Family) Name(s):
First (Given) Name(s):
Lecture Sect
UNIVERSITY OF TORONTO
Faculty of Arts and Science
26
406
6'
4
0 CSC 263H1 S
4 St. George Campus
Duration 3 hours
Examination Aids: One 8.5 x 11 sheet of paper, handwritten on both sides N O calculator
UNIVERSITY OF TORONTO
Faculty of Arts and Sciences
AUGUST EXAMINATIONS 2004
CSC 263 H1 Y
Duration 3 hours
No Aids Allowed
Name _._ Student No.
Answer ALL questions on test paper. Total pages: 20 (incl
(b) (10 points) Show how to implement MAXAREA (D ,p). What is its worst-case running time?
Explain.
11 pontd . . (c) (4 points) Show how to maintain the new information during a rotation. Why does the