Midterm spring. CSC228H University of Toronto

Similar documents
University of Toronto Mississauga. Flip to the back cover and write down your name and student number.

IMPORTANT: Circle the last two letters of your class account:

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

CS-245 Database System Principles

University of Toronto Mississauga. Flip to the back cover and write down your name and student number.

Database Applications (15-415)

Some Practice Problems on Hardware, File Organization and Indexing

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

13 File Structures. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

CS 222/122C Fall 2016, Midterm Exam

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

CSE 373 Spring 2010: Midterm #2 (closed book, closed notes, NO calculators allowed)

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

CSE 373 Spring 2010: Midterm #1 (closed book, closed notes, NO calculators allowed)

CS 245 Midterm Exam Winter 2014

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

Name: Instructions. Problem 1 : Short answer. [56 points] CMU Storage Systems 25 Feb 2009 Spring 2009 Exam 1

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

University of California, Berkeley. CS 186 Introduction to Databases, Spring 2014, Prof. Dan Olteanu MIDTERM

COSC-4411(M) Midterm #1

Final Examination CSE 100 UCSD (Practice)

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

CS251-SE1. Midterm 2. Tuesday 11/1 8:00pm 9:00pm. There are 16 multiple-choice questions and 6 essay questions.

CMPUT 101 with Solutions Quiz 2 (50 minutes) August 7, 2002

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

CSC369H1 S2016 Midterm Test Instructor: Bogdan Simion. Duration 50 minutes Aids allowed: none. Student number:

14.4 Description of Huffman Coding

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 7, 2003

WYSE Academic Challenge 2002 Computer Science Test (Sectional) SOLUTION

Name: Instructions. Problem 1 : Short answer. [48 points] CMU Storage Systems 27 Feb 2008 Spring 2008 Exam 1

Name: Instructions. Problem 1 : Short answer. [63 points] CMU Storage Systems 12 Oct 2006 Fall 2006 Exam 1

Building an Inverted Index

Hashing IV and Course Overview

For undergraduate courses in assembly language programming and introductory courses in computer systems and computer architecture.

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin

Student Number: Lab day:

Third Midterm Exam April 24, 2017 CS162 Operating Systems

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 16, 2000

File System Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Midterm 1: CS186, Spring I. Storage: Disk, Files, Buffers [11 points] cs186-

UNIVERSITY OF TORONTO Faculty of Arts and Science

University of Waterloo Department of Electrical and Computer Engineering ECE250 Algorithms and Data Structures Fall 2017

COSC-4411(M) Midterm #1

Midterm #2 Exam April 26, 2006 CS162 Operating Systems

CIS Business Computer Forensics and Incident Response. Lab Protocol 02: FileSystems/VM

CS350 Midterm Spring 2012 Page 1

Data Structures and Algorithms

2.Simplification & Approximation

1. Which of the following Boolean operations produces the output 1 for the fewest number of input patterns?

Midterm solutions. n f 3 (n) = 3

EECE.4810/EECE.5730: Operating Systems Spring 2017

Extra: B+ Trees. Motivations. Differences between BST and B+ 10/27/2017. CS1: Java Programming Colorado State University

Spring 2013 CS 122C & CS 222 Midterm Exam (and Comprehensive Exam, Part I) (Max. Points: 100)

CS-537: Final Exam (Fall 2013) The Worst Case

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

Representing Data Elements

File System Implementation

Storage hierarchy. Textbook: chapters 11, 12, and 13

R16 SET - 1 '' ''' '' ''' Code No: R

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25

CMU Storage Systems 11 Oct 2005 Fall 2005 Exam 1

CSE 530A. B+ Trees. Washington University Fall 2013

1993 Illinois JETS TEAMS Regional Computer Fundamentals Test. a. 3 b. 8 c. 12 d. 16 e. 20

Algorithms and Data Structures Spring 2008

UNIVERSITY OF TORONTO Faculty of Arts and Science. Midterm Sample Solutions CSC324H1 Duration: 50 minutes Instructor(s): David Liu.

CMU Storage Systems 20 Feb 2004 Fall 2005 Exam 1. Name: SOLUTIONS

Overview of Storage & Indexing (i)

CSE 373 Sample Midterm #2 (closed book, closed notes, calculators o.k.)

Compressing Integers for Fast File Access

CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators)

CS Operating system

Guide for students. Login

Faculty of Environment and Technology

Comp 335 File Structures. Indexes

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

Prelim 2. 5:30 PM, 25 April Total Question Name Short Search/ Collections Trees Graphs. Max Score Grader

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Python Working with files. May 4, 2017

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

CSC209S Midterm (L0101) Spring 1999 University of Toronto Department of Computer Science

Database Technology. Topic 7: Data Structures for Databases. Olaf Hartig.

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

ECE 3055: Final Exam

Computer Science Engineering Sample Papers

Spring 2016 Algorithms Midterm Exam (Show your work to get full credit!)

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

CSCE 212: FINAL EXAM Spring 2009

CMPE012 Computer Engineering 12 (and Lab) Computing Systems and Assembly Language Programming. Summer 2009

GNSS High Rate Binary Format (v2.1) 1 Overview

Disks & Files. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

File Management By : Kaushik Vaghani

NONE (in particular, no calculator)

Tutorial for Chapter 3, 4

Midterm Exam #2 Solutions April 20, 2016 CS162 Operating Systems

Data Structure (CS301)

Student Number: Instructor: Reid Section: L0101 (10:10-11:00am)

Question Points Score Total: 100

Complete Binary Trees

Microsoft Compound Document File Format

Transcription:

Midterm 2002 - spring CSC228H University of Toronto Duration 50 minutes Aids Allowed: none. No calculators. Student Number: Last Name: First Name: Instructor: TA: Do not turn this page until you have received the signal to start #1: / 12 #2: / 12 #3: / 16 #4: / 8 #5: / 10Total: / 58 Good Luck! PLEASE HAND IN

Question 1. [12 marks] Given a Disk with the following characteristics: 64 sectors / track 512 bytes / block Rotational delay: 10ms Transfer rate: 2048 bytes / ms Seek time: 20ms Part (a) [6 marks]: How many tracks would be needed to store a file with 4096000 bytes? 4096000 [bytes] / 512 [bytes / block] = 8000 blocks 8000 [blocks] / 64 [blocks / track] = 125 tracks Part (b) [6 marks]: How long would we take to read the whole file in sequence, assuming no interruptions while reading a track? 125 x (20+ 10) = 3750ms (due to seek time and rotational delay) 4096000 / 2048 = 2000 ms (due to transfer rate) t = 3750 + 2000 = 5750 ms 2/5

Question 2. [12 marks] Assuming we have a data file with 1000 records. Each record contains 4 fields with one unsigned integer (4-bytes) each. What would the minimum file size (no compression) be if, on average: Part (a) [3 marks]: The values of the fields are 2 (decimal) digits long and you write the file in text mode, with a 1-byte field delimiter and a 1-byte record delimiter. On average, 2 decimal digits 2bytes ( 4 [fields / record] x ( 2 [bytes / field] + 1 [byte / field delimiter] ) + 1 [byte / record delimiter] ) x 1000 [records] = 13000 bytes Part (b) [3 marks]: The values of the fields are 2 (decimal) digits long and you write the file in binary mode, with fixed length fields. Since the fields are fixed length, we have to attend all possibilities, not only the average case, therefore, 4 bytes. We don t have delimiters in this case. 4 [fields / record] x 4 [bytes / field] x 1000 [records] = 16000 bytes Part (c) [3 marks]: The values of the fields are 2 (decimal) digits long and you write the file in text mode, with fixed length fields. If you want to represent the 4 bytes in the field ( FF FF FF FF = 2^32 1 = 4,294,967,295 ) we have to allocate space for 10digits 10bytes in text mode. We have again not to consider the average case, since the fields are fixed length. 4 [fields / record] x 10 [bytes / field] x 1000 [records] = 40000 bytes Part (d) [3 marks]: Why would it be difficult to deal with a binary file and field delimiters, in this example? Because in a binary file, all characters (00 FF) may occur in the data, becoming difficult to choose a character as a field delimiter. 3/5

Question 3. [16 marks] Given a B-tree order 7, what is: Part (a) [2 marks]: The minimum number of children that the root node can 2 Part (b) [2 marks]: The maximum number of children that the root node can 7 Part (c) [2 marks]: The minimum number of data values that the root node can 1 Part (d) [2 marks]: The maximum number of data values that the root node can 6 Part (e) [2 marks]: The minimum number of children that a node can 4 Part (f) [2 marks]: The maximum number of children that a node can 7 Part (g) [2 marks]: The minimum number of data values that a node can 3 Part (h) [2 marks]: The maximum number of data values a node can 6 4/5

Question 4. [8 marks] When would you use the following file compression techniques (give ONE typical case for each): Run-Length code: Whenever there is a significant amount of equal characters in sequence. Variable-Length code: Whenever certain characters are more frequent than others. Question 5. [10 marks] Part (a) [5 marks]: Explain briefly the co-sequential processing. 1 sorted Master File and 1 Transaction File or two or more sorted input files producing one or more output files The Master File and the Transaction File are read in sequence AND in parallel The Transaction File specifies operations in the Master File like matching, merging and updating Part (b) [5 marks]: What are the bigohs involved when the transaction file is sorted and non-sorted? (State the meaning of the variable(s) you use) Answer: Considering: M Number of entries in the Master File N Number of entries in the Transaction File Sorted:O(M+N)[ Since I read in sequence in each file, never going back ] Non-sorted: O( M x N ) [ Since for each element in the TF I have to seek for the correspondent element in the MF, always starting over from the beginning] Obs.: Explanation not required, but the elements have to be identified. 5/5