CSC 207H Fall L Java Quiz Duration 25 minutes Aids allowed: none

Similar documents
Good Luck! CSC207, Fall 2012: Quiz 1 Duration 25 minutes Aids allowed: none. Student Number:

Computer Science 62. Midterm Examination

Student Number: Legibly write your name and student number on this page. Legibly write your name on the back page of this exam.

Please note that if you write the mid term in pencil, you will not be allowed to submit a remark request.

No Aids Allowed. Do not turn this page until you have received the signal to start. Read this entire page or you ll miss the bonus question.

No Aids Allowed. Do not turn this page until you have received the signal to start.

Good Luck! CSC207, Fall 2012: Quiz 3 Duration 25 minutes Aids allowed: none. Student Number: Lecture Section: L0101. Instructor: Horton

Introduction to Computing II (ITI 1121) FINAL EXAMINATION

No Aids Allowed. Do not turn this page until you have received the signal to start.

Computer Science 62. Bruce/Mawhorter Fall 16. Midterm Examination. October 5, Question Points Score TOTAL 52 SOLUTIONS. Your name (Please print)

CS 455 Midterm Exam 2 Fall 2015 [Bono] Nov. 10, 2015

CS 455 Midterm Exam 1 Fall 2017 [Bono] Thursday, Sep. 28, 2017

Please note that if you write the mid term in pencil, you will not be allowed to submit a remark request.

Introduction to Computer Science II (CSI 1101)

CIS 110 Introduction to Computer Programming Summer 2016 Final. Recitation # (e.g., 201):

CSE 131S Introduction to Computer Science Summer SON Exam III

Largest Online Community of VU Students

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

CS 455 Midterm Exam 1 Fall 2015 [Bono] Thursday, Oct. 1, 2015

CSE 131 Introduction to Computer Science Fall Exam III

CPSC 35 Midterm Exam

Introduction to Computer Science II (ITI 1121) Midterm Examination

CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016

Student Number: Please fill out the identification section above as well as the one on the back page, and read the instructions below. Good Luck!

Student Number: Lab day:

CIS 110 Introduction to Computer Programming Summer 2017 Final. Recitation # (e.g., 201):

CS 455 Final Exam Spring 2018 [Bono] May 8, 2018

CS231 - Spring 2017 Linked Lists. ArrayList is an implementation of List based on arrays. LinkedList is an implementation of List based on nodes.

CSC 209H1 S 2012 Midterm Test Duration 50 minutes Aids allowed: none. Student Number: # 1: / 7

10/1/2018 Data Structure & Algorithm. Circularly Linked List Doubly Linked List Priority queues Heaps

CSE 142 Wi04 Midterm 2 Sample Solution Page 1 of 8

CIS 110 Introduction to Computer Programming Summer 2016 Final. Recitation # (e.g., 201):

CMSC 433 Section 0101 Fall 2012 Midterm Exam #1

CSC 172 Data Structures and Algorithms. Lecture #8 Spring 2018

Data Structure (CS301)

UNIVERSITY OF TORONTO Faculty of Arts and Science

Exam Duration: 2hrs and 30min Software Design

Introduction to Computer Science II (CSI 1101) Midterm Examination

Midterm Exam 2 CS 455, Spring 2011

Introduction to Computing II (ITI 1121) Final Examination

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CS 113 MIDTERM EXAM 2 SPRING 2013

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

CIS 110 Introduction to Computer Programming Summer 2018 Final. Recitation # (e.g., 201):

CSC 108H1 F 2009 Test 1 Duration 35 minutes Aids allowed: none. Student Number:

CS 115 Exam 3, Spring 2011

Title Description Participants Textbook

Student Number: Lecture Section: Daytime

Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total.

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

CS 455 Midterm 2 Spring 2018 [Bono] Apr. 3, 2018

CSC 209H1 S 2012 Midterm Test Duration 50 minutes Aids allowed: none. Student Number: # 1: / 6

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

Implementation. Learn how to implement the List interface Understand the efficiency trade-offs between the ArrayList and LinkedList implementations

Ryerson University Vers HAL6891A-09 School of Computer Science CPS109 Midterm Test Fall 09 page 1 of 7

CS 455 Midterm Exam 2 Fall 2016 [Bono] November 8, 2016

1. Data types ( =13 points)

Introduction to Linked Data Structures

CSE 143 Sp03 Final Exam Sample Solution Page 1 of 13

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Java Object Oriented Design. CSC207 Fall 2014

CS S-20 Linked Lists IV 1

Computer Science 136. Midterm Examination

Introduction to Computer Science II (ITI 1121) Final Examination

CS 110 Practice Final Exam originally from Winter, Instructions: closed books, closed notes, open minds, 3 hour time limit.

Midterm Exam 2 CS 455, Spring 2015

LINEAR INSERTION SORT

FINAL EXAMINATION. COMP-250: Introduction to Computer Science - Fall 2011

CS 455 Midterm Exam 1 Spring 2011 [Bono] Feb. 17, 2011

Interfaces & Generics

Eng591 - Virtual Reality Programming First Mid-Term Exam

CS 455 Final Exam Fall 2012 [Bono] Dec. 17, 2012

CS61B, Summer 2002 Exam #1 Barath Raghavan

Exercise 12 Initialization December 15, 2017

CIS 110 Introduction to Computer Programming Spring 2016 Final Exam

Introduction to Computer Science II (CSI 1101) Midterm Examination

CS 455 Midterm Exam 1 Spring 2013 [Bono] Feb. 21, 2013

CIS 110 Introduction to Computer Programming Summer 2018 Final. Recitation # (e.g., 201):

16. Dynamic Data Structures

CS 455 Final Exam Fall 2015 [Bono] Dec. 15, 2015

Final. Please write (printing clearly) the infonnation requested in the boxes at the top of this page.

CSE373 Fall 2013, Second Midterm Examination November 15, 2013

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

Lecture 9: Lists. MIT-AITI Kenya 2005

Chapter 6 Introduction to Defining Classes

CIS Introduction to Computer Programming Spring Exam 2

CS 231 Data Structures and Algorithms Fall Binary Search Trees Lecture 23 October 29, Prof. Zadia Codabux

Exercise 12 Initialization December 14, 2018

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

CSC A20H3 S 2011 Test 1 Duration 90 minutes Aids allowed: none. Student Number:

Prelim 1. CS 2110, 13 March 2018, 5:30 PM Total Question Name Short answer

CS 455 Final Exam Fall 2016 [Bono] December 13, 2016

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

! Determine if a number is odd or even. ! Determine if a number/character is in a range. ! Assign a category based on ranges (wind speed)

Data Structures and Algorithms Winter term 2016

Birkbeck (University of London) Software and Programming 1 In-class Test Mar 2018

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 6, January 28, 2016

Model Solutions. COMP 102: Test May, 2015

1.00/1.001 Introduction to Computers and Engineering Problem Solving. Final Exam

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

Transcription:

CSC 207H Fall L0101 2011 Java Quiz Duration 25 minutes Aids allowed: none Last Name: Student Number: First Name: (Please fill out the identification section above and read the instructions below.) Good Luck! This midterm consists of 2 questions on 8 pages (including this one). When you receive the signal to start, please make sure that your copy is complete. If you use any space for rough work or need to scratch out an answer, circle what you want marked to indicate that it is the answer you are submitting. # 1: / 5 # 2: /12 TOTAL: /17 Total Pages = 8 Page 1 cont d...

Question 1. [5 marks] Suppose you have just checked out a copy of the repository (local copy 1) with the following files and their contents: planets.txt seasons.txt prime numbers.txt Mercury Summer 2 Mars Fall 3 Jupiter Spring 5 Saturn 7 Venus Part (a) [2 marks] Suppose you now execute the command svn remove planets.txt, append a line containing Winter to seasons.txt, and create an empty file named empty.txt in the directory containing local copy 1. What will the output of svn status be? Part (b) [1 mark] If someone were to, without running any more commands in the directory containing local copy 1, check out a new copy of the repository (local copy 2), what files would be found and what would their contents be? (You can describe it in English if you like.) Page 2 of 8 cont d...

Part (c) [2 marks] If empty.txt in the directory containing local copy 1 is modified to contain the line Hello world, what command(s) would you need to execute so that the changes are reflected in the directory containing local copy 2? Make sure to indicate where the commands you write are executed (i.e., local copy 1 or local copy 2). Page 3 of 8 cont d...

Question 2. [12 marks] Consider the following code for a doubly-linked list: public static class LinkedListNode { private LinkedListNode next; private LinkedListNode prev; private int value; /** * Constructor for a new LinkedListNode. Appends this node to prev. * Preconditions: prev is the last element in a linked list. * * @param value The value of this node. * @param prev The previous node in the linked list. */ public LinkedListNode(int value, LinkedListNode prev) { this.prev = prev; if (prev!= null) { prev.next = this; this.value = value; /** * Return the value stored in this node. * * @returns the value stored in this node. */ public int getvalue() { return this.value; /** * Return the next node in the LinkedList. * * @returns the next node in the LinkedList. */ public LinkedListNode getnext() { return this.next; public static void main(string argv[]) { LinkedListNode anode = new LinkedListNode(13, null); new LinkedListNode(7, anode); anode.moveforward(); Page 4 of 8 cont d...

Part (a) [2 marks] Draw the object(s) created by the following expression. You do not need to draw the full memory model, just the object. You also do not need to include any method signatures in your object. new LinkedListNode(13, null) Part (b) [4 marks] In the next question, you will be writing a method moveforward that takes no parameters. Draw the Java memory model diagram just after Java calls the moveforward() method on line 3 of method main. Page 5 of 8 cont d...

Part (c) [3 marks] Write a method named moveforward() that takes no arguments in the LinkedListNode class that, if there is another LinkedListNode after this one, swaps the current node with the next one. Include comments as necessary. Page 6 of 8 cont d...

Part (d) [5 marks] Create a method named sort() in LinkedListNode that, if called from another method, reorders the linked list connected to the LinkedListNode into non-decreasing order (i.e., the value of element n is the value of element n + 1). You may assume your moveforward() method from the previous question works. We suggest using gnome sort or modifying bubble sort. Include comments as necessary. Page 7 of 8 cont d...

This page is for rough work and for answers that didn t fit in the space provided. Page 8 of 8 End of Examination