CS110-001 Programming and Problem Solving
Assignment Three (Due on March 3, 2017)
All assignments are to be submitted to UR Courses. Please note that the due time of each assignment
is at 10:00 pm (UR Course time) on the due date. Please make sure to save
CS110 Programming and Problem Solving (Winter 2017)
Assignment One (Due on January 27, 2017)
All assignments are to be submitted to UR Courses. Please note that the due time of each
assignment is at 10:00 pm (UR Course time) on the due date. Please make s
CS110 Programming and Problem Solving
Assignment Zero (Due on January 13, 2017)
Note: This is a warm-up assignment. You may get up to ONE bonus mark toward your final
grade for this assignment.
All assignments are to be submitted to UR Courses. Please not
CS110 Programming and Problem Solving
Assignment Two (Due on Feb 10, 2017)
All assignments are to be submitted to UR Courses. Please note that the due time of each
assignment is at 10:00 pm (UR Course time) on the due date. Please make sure to save the
ch
CS 350: Programming Languages Concepts (Winter 2017)
Assignment 2
Chapter 3
Review Questions (3 marks for each question - Total: 21 marks)
1. Define syntax and semantics.
Syntax: the form or structure of the expressions, statements, and program units
Sema
CS 350: Programming Languages Concepts (Winter 2017)
Assignment 1
Due Date and Time: Tue, January 31, 2017 at 11:55 PM
Chapter 1
1. (12 marks). Write an evaluation of a language you know, using the criteria listed below.
Assign a letter grade (A through E
CS 350: Programming Languages Concepts (Winter 2017)
Assignment 3
Problem Set Solution
Chapter 5
Problem Set (3 marks each total: 15)
Choose only 5 problems out of the 8 following problems and provide your answers
1. Write a simple assignment statement wi
Final Exam
Dr Malek Mouhoub
CS340 Winter 2006
Wednesday April 19 2006
Duration : 3 hours
Total : 50pts
(The question paper should be handed in with the completed examination)
Exercise 1 : Algorithm Design Techniques [0.5x6+0.5x6=6pts]
When introducing the
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
6. Algorithm Design Techniques
6. Algorithm Design Techniques
6.1 Greedy algorithms
6.2 Divide and conquer
6.3 Dynamic Progra
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
4. Sorting and Order-Statistics
4. Sorting and Order-Statistics
The sorting problem consists in the following :
Input : a seq
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
2. Trees
2. Trees
2.1 Preliminaries
2.2 Binary trees
2.3 Binary search trees
2.4 AVL and Splay trees
2.5 B-trees
2
2.1 Prelim
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
5. Graphs and Networks
CS340
5. Graphs and Networks
Plan :
5.1 Introduction and definitions.
5.2 Representation of Graphs.
Data Structures and Algorithm Analysis
Instructor: Dr. Malek Mouhoub
Computer Science Department
University of Regina
Fall 2016
1
3. Priority Queues
3. Priority Queues
ADT Stack : LIFO.
ADT Queue : FIFO.
ADT Priority Queue : pick the element with the l
SANKIT PATEL
CS-301
04-MAR-2017
Assignment-4
Question 1
(based on Question 7.18 in Clements)
A processor executes an instruction in the following six stages. Taken separately, the time required by
each stage in picoseconds (1,000 ps = 1 ns) is given for e
Assignment # 1
R-5 . 1 Let S = cfw_a, b, c, d, e, j, g be a collection of objects with benefit-weight
values as follows: a: ( l 2, 4) , b: ( 1 0, 6) , c: (8, 5) , d: ( 1 1 , 7) , e: (14, 3) , f: (7,
1 ) , g: (9, 6).What is an optimal solution to the fract
Alex Dalusong
200304912
Exercise 1:
What is the worst-case running time of Djikstras algorithm when implemented with d-heaps .
Answer:
Every time the main loop executes, one vertex is extracted from the queue. Assuming that there are V
vertices in the gra
University of Regina
Faculty of Science
Midterm Examination #1
Fall 2016
Student Name _
Student ID #
_
Course Number
CS 330
Course Title
Introduction to Operating Systems
Department
Computer Science
Instructor
Dr. Maher Elshakankiri
Date of Exam
October 1
CS 340
Assignment 3
Total: 100pts
Dr. Malek Mouhoub
Exercise 1 : exercise 7.41 page 310 [8pts]
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algorithm to sort 4 elements in 5 comparisons.
Exercise 2 : e
University of Regina
Faculty of Science
Midterm Examination #2
Fall 2016
Student Name _
Student ID #
_
Course Number
CS 330
Course Title
Introduction to Operating Systems
Department
Computer Science
Instructor
Dr. Maher Elshakankiri
Date of Exam
November
Alex Dalusong
200304912
Exercise 1:
What is the worst-case running time of Djikstras algorithm when implemented with d-heaps.
Answer:
Every time the main loop executes, one vertex is extracted from the queue. Assuming that there are V
vertices in the grap
University of Regina
CS 340
Assignment #4
Written Part: Graph Algorithms [48pts]
Exercise 1: exercise 9.6 page 379 (9.6 page 437 on 4th ed.) [4pts]
What is the worst-case running time of Djikstras algorithm when implemented with d-heaps.
Exercise 2 : exer
Alex Dalusong
200304912
Exercise 1
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algorithm to sort 4 elements in 5 comparisons.
Answer:
log 4! = log 24 < log 32 = log (2^5) = 5 comparisons required
For
Alex Dalusong
200304912
1.) What is the main difficulty that a programmer must overcome in writing an operating system for
a real-time environment?
-the most difficult part in writing an operating system for a real-time environment is making sure the
syst
Alex Dalusong
200304912
Exercise 1
1. Prove that any comparison-based algorithm to sort 4 elements requires 5 comparisons.
2. Give an algorithm to sort 4 elements in 5 comparisons.
Answer:
log 4! = log 24 < log 32 = log (2^5) = 5 comparisons required
For
CmSc 250 Fundamentals of Computing III
Homework 05 SOLUTION
1. Determine the running time of mergesort for
a. Sorted input
b. Reverse-ordered input
c. Equal elements
Explain your answers.
In the three cases the running time is O(NlogN). It is computed bas
Alex Dalusong
200304912
Assignment #3
CS 330
1.) Which of the following components of program state are shared across threads in a
multithreaded process?
a. Register values
b. Heap memory
c. Global variables
d. Stack memory
Answer: Heap Memory and Global
SANKIT PATEL
CS-301
200333678
Assignment 2
Question 1
Do Question 3.13 in Clements
If r1 = 00FF16, and r2 = 4, what is the value of r0 after each of the following instructions has been executed (assume
that each instruction uses the same data)?
a. ADD r0,
200333678
CS-301
Assignment 3
10-Feb-2017
Question 1
Do Question 6.13 in Clements
A computer has the following parameters.
If the average performance of the computer (in terms of its CPI) is to be increased by 20% while
executing the same instruction mix,
CS110-002: Programming and Problem Solving
Winter, 2016
Assignment 3
Solution Key
Notes:
Solution keys are in red color.
Only critical parts of each program is provided
Programming Questions (60 marks)
Q1.
Modified based on Programming Exercise 4.2 and 4.
CS110-002: Programming and Problem Solving
Winter, 2016
Assignment 2
Solution Key
Q1.
The bool Data Type (Q3.3, page 73)
Show the printout of the following code:
bool b = true;
int i = b;
cout < b < endl;
cout < i < endl;
Answer:
1
1
Q2.
Two-Way if-else S