C: (x SHJ C 'lQr ( \VQ \/ 00 Cl RR; ii
Family Name:
Given Name:
Student ID:
University of Alberta
Faculty of Science
Fall 2000
CMPUT 291 A1
File Structures and Data Management
El
Duration: 2 Hours
NoAids Allowed 'UUJJO
>m>g
003-0
QSEC
. -|
'n
0029
a 2
E;
EiSHJC *0 r . V woo cl Rag; 41
CMPUT 291 /A1 Midterm Exam - Fall 2000 Page 1 of 5
Student name: Student ID:
General Guidelines: Exam duration: 70 min; Total: 6 questions, 50 marks; No aids allowed.
Question 1
[ 8 marks in total ] TRUE or FALSE: 2 marks fo
Prof. Li-Yan Yuan
CMPUT 291: File and Database Management Systems
Midterm Examination
March 1, 2001
It is a close-book examination and the time for the test is 80 minutes. There are ve(5) questions over two
(2) pages. The value of each question is indicat
The Relational Data Model
Davood Rafiei
1
Data Model
Need a model for describing
Data, its structure and constraints
Operations on data
Describe data at some abstraction layer
(schema)
External
Conceptual
Physical
2
Physical Level
Data descripti
Divide and Conquer and recursive programs
I
Week 3: Solving recurrences
I
Agenda:
I
Divide and Conquer and analyzing recursive programs
I
Solving recurrences
I
Iterated substitution
I
Recursion tree method
I
Guess and test method
I
Master Theorem method
A
Week 4: Heaps
Heaps data structure (recall):
Week 4: Heapsort, Quicksort
I
Agenda:
I
I
Heaps:
I
I
I
I
Max-Heapify
Build-Max-Heap
Heapsort
I
Priority Queues
I
Quicksort
I
I
Reading:
I
An array A[1.n] of n comparable keys (either or )
An implicit binary tre
Insertion sort pseudocode (recall)
Week 2: Types of analysis of algorithms, Asymptotic notations
InsertionSort(A) *sort A[1.n] in place
Agenda:
I
Worst/Best/Avg case analysis
I
InsertionSort example
I
Loop invariant
I
Asymptotic Notations
I
Refreshment on
CMPUT 379, Assignment 3, Winter 2017
(Topics: paging, MMU, TLB, virtual memory)
Objective
You will implement a simulator to study the TLB behavior and the page eviction
policy of a virtual memory subsystem. A number of traces of 32-bit memory
references a
CMPUT 379, Assignment 2, Winter 2017
(Sockets, Synchronization, Message Passing, Encryption)
Objective
You are asked to implement a whiteboard server and its accompanying client.
Developing the solution requires that you get familiar with programming usin
CMPUT 379, Assignment 1, Winter 2017
(Address space layout of processes, UNIX signals)
Objective
You are asked to program a C function in a single source file with the following
synopsis:
#define MEM_RW 0
#define MEM_RO 1
struct patmatch cfw_
unsigned int
CMPUT 175 A1: Final exam
Instructor: Marianne Kerolus
Percentage: 40%
Date: December 18, 2015
Name:
ID:
Grade:
_ / 100
This final exam has 5 questions, and a total of 8 pages.
This is a closed book exam (except for a total of 6 pages of cheat sheets prepa
CMPUT 175 A2: Final exam
Instructor: Marianne Kerolus
Percentage: 35%
Date: December 15, 2014
Name:
ID:
Grade:
_ / 80
SOLUTIONS
Question 1:
(20 marks)
Time-complexity: Thoroughly compare the time complexities of Bubble sort and Selection sort in each of
t
f = open('accounts.txt','r') # open the file
string = f.read() # read the file
list_of_strings = string.split('\n') # create a list of string
pairs = [] # initialize a list of pairs
for character in list_of_strings: # check for each character in list_of_s
from Stack import Stack
#
- #
# set the Home Page
HomePage = 'www.cs.ualberta.ca'
#
- #
# initialize all the stacks
# push the Home Page to the current page
CurrentPage = Stack()
CurrentPage.push(HomePage)
PreviousPage = Stack()
#
- #
# print the message
f= open('rainfall.txt','r') # open the file
string = f.read() # read the file
list_of_string = string.split() # split the string
rainfall = cfw_ # create an empty dict of the data given the region as keys
for index in range(0,len(list_of_string)/2):
index
import random
class TicTacToe:
def _init_(self):
# "board" is a list of 10 strings representing the board (ignore index
0)
self.board = [" "]*10
self.board[0]="#"
def drawBoard(self):
# This method prints out the board with current plays adjacent to a boa
import random
number = random.randint(1, 20) # generate the number that needs to guess
def main():
# main program
# start with guess = 0, for every answer, guess will increment by 1
depending on the status of the answer
# if the answer is lower/higher/not
f = open('earthquake.txt','r') # open the file
string = f.read() # read the file
list_of_string = string.splitlines() # split the lines between the string and
create a list
def output():
# create the dictionary of earthquake data
# by spliting up the elem
week 1: Introduction
Official course information
Week 1: Introduction, Basic Concepts
I
I
CMPUT204: Introduction to Algorithms
Lectures: MWF, 10:00-10:50 (TEL 150)
Seminars (starting from the second week of the term)
I
I
I
Agenda:
I
Course information
I
A
CMPUT 204
Department of Computing Science
University of Alberta
Notes on Growth of Functions
Here are some justifications for the order of growth given in the lecture notes. Sometimes we igve a
formal proof, sometimes we give an intuitive argument, and so
Week 2: Insertion Sort
Week 2: Types of analysis of algorithms, Asymptotic notations
Insertion sort pseudocode (recall)
Agenda:
I
Worst/Best/Avg case analysis
I
InsertionSort example
I
Loop invariant
I
Asymptotic Notations
I
Refreshment on logs and exps
I
Week 4: Heaps
Heaps data structure (recall):
Week 4: Heapsort, Quicksort
I
Agenda:
I
I
Heaps:
I
I
I
I
Max-Heapify
Build-Max-Heap
Heapsort
I
Priority Queues
I
Quicksort
I
I
CLRS: 151-169
CLRS: 170-190
A[2j] is the left child of A[j]
A[2j + 1] is the right
Week 5: QuickSort
Recall QuickSort :
I
I
Week 5: QuickSort, Randomness, Lower bound
I
I
Agenda:
I
QuickSort : Worst, Best and Average case
I
Random QuickSort
I
Lower bound for sorting
I
Pick one key
Compare to others: partition into smaller and greater su
Divide and Conquer and recursive programs
I
Week 3: Solving recurrences
I
Agenda:
I
Divide and Conquer and analyzing recursive programs
I
Solving recurrences
I
Iterated substitution
I
Recursion tree method
I
Guess and test method
I
Master Theorem method
A
Week 8: Greedy Algorithms
Agenda:
I
Week 8: Algorithm Design Techniques
Greedy Algorithms
I
Fractional Knapsack
I
Activity Selection
I
Job Scheduling on Multi-processors
Algorithm Design Techniques:
I Three major design techniques are:
1. Divide and Conqu
Week 10: Graphs and Graph Traversals
Agenda:
Week 10: Graphs
Graphs basic definitions
I Graphs Representation
I Graph Traversals: Breadth First Search (BFS) and applications
Reading:
I CLRS: 589-602; also 1168-1172 (Appendix B.4)
I
Q: Why study graphs?
A
Week 8: More Divide and Conquer
Example 1: Multiplication of large integers :
Week 8: More Divide and Conquer
I
Suppose we are dealing with integers that have hundreds of (binary) bits
(e.g. 256 or 512 bits).
I
Such integers are too big to fit into one me
Week 9: Dynamic Programming
Dynamic programming introduction:
Week 9: Dynamic programming
Agenda:
I
Introduction
I
0/1 Knapsack (briefly mentioned on page 425 of CLRS)
I
Chain Matrix Multiplication (pages 373-378 of CLRS)
I
Longest Common Subsequence (pag
CMPUT 201: Practical Programming Methodology
Guohui Lin
[email protected]
Department of Computing Science
University of Alberta
November 2016
Lecture 19: Advanced Uses of Pointers
Agenda:
Four major uses of pointers
Dynamic storage allocation
Dynamica
CMPUT 201: Practical Programming Methodology
Guohui Lin
[email protected]
Department of Computing Science
University of Alberta
November 2016
Lecture 24: The Standard Library
Agenda:
General guidelines
Using a macro to hide a function
Overview of the