CSE 341 Parallel and Sequential Algorithms
Homework 2 Solutions
Assigned: 02/13/2013
Due Date: 03/04/2013
In this homework you will design some efcient parallel algorithms using techniques you have
learned, especially, divide and conquer, scan, etc. Your
CSE341T
Homework 1
Assigned: 09/02/2015
Due Date: 09/21/2015
In this assignment, you will solve some simple problems that teach you to design and analyze
parallel algorithm using the techniques you have learnt in class.
Problem 1-1. The Stock Market Probl
CSE341T
09/02/2015
Matrix Multiplication
Lecture 4
Today, we will look at various algorithms for computing matrix multiplication and analyze the
work, span, and parallelism of these algorithms.
Before we look at the problem of matrix multiplication, lets
From Procedural to Object-oriented Programming
Procedural programming
Functions have been the main focus so far
Function parameters and return values
Exceptions and how the call stack behaves
We have viewed data and functions as being
separate abstra
CSE 332 Overview and Structure
CSE 332 emphasizes studio-based active learning
Introductory lecture material followed by hands-on exercises
More time in guided exploration than in passive absorption
Key insight: different people learn in different way
C+ Program Structure (and tools)
Today well talk generally about C+ development
(plus a few platform specifics)
Well develop, submit, and grade code in Windows
Its also helpful to become familiar with Linux
E.g., on shell.cec.wustl.edu
For example, ru
Built-In (a.k.a. Native) Types in C+
int, long, short, char (signed, integer arithmetic)
unsigned versions too
unsigned int, unsigned long, etc.
C+ guarantees a char is one byte in size
Sizes of other types are platform dependent
Can determine using
Expressions: Operators and Operands
Operators obey arity, associativity, and precedence
int result = 2 * 3 + 5; / assigns 11
Operators are often overloaded for different types
string name = first + last; / concatenation
An lvalue gives a location; an r
Why Use Namespaces?
Classes encapsulate behavior (methods) and
state (member data) behind an interface
Structs are similar, but with state accessible
Classes and structs are used to specify selfcontained, cohesive abstractions
Can say what class/struc
C+ Statements
In C+ statements are basic units of execution
Each ends with ; (can use expressions to compute values)
Statements introduce scopes, e.g., of (temporary) variables
A (useful) statement usually has a side effect
Stores a value for future u
CSE341T
08/31/2015
Cost Model: Work, Span and Parallelism
Lecture 3
In this lecture, we will look at how one analyze a parallel program written using Cilk Plus.
When we analyze the cost of an algorithm formally, we need to be reasonably precise in what
mo
CSE341T
09/14/2015
Merge Sort, Quicksort (intro)
Lecture 6
We came up with a parallel merge last time, but did not nish analyzing it.
1
Parallel Merge
Problem Statement: Given two arrays B[1.m] and C[1.l], each of which is sorted, we want to
merge them in
CSE 341 Parallel and Sequential Algorithms
Homework 5 Solutions
Assigned: 04/17/2013
1
Due Date: 04/29/2013
Introduction
For the coding portion of the assignment, you will implement several methods for managing a
Treap, namely split, join, union and inter
CSE 341 Parallel and Sequential Algorithms
Homework 3 Solutions
Assigned: 03/06/2013
Due Date: 03/25/2013
In this assignment, you will implement quicksort and analyze it. In addition, you will solve some
problems about graphs, and nally practice your prob
CSE 341 Parallel and Sequential Algorithms
Homework 4 Solutions
Assigned: 03/25/2013
1
Due Date: 04/15/2013
Introduction
You will begin this assignment by doing a simple analysis of a couple of algorithms, and apply
maximal independent set algorithm you l
CSE341T
Homework 1
Assigned: 09/07/2015
Due Date: 09/26/2015
In this assignment, you will solve some simple problems that teach you to design and analyze
parallel algorithm using the techniques you have learnt in class.
Problem 1-1. The Stock Market Probl
CSE341T
Homework 0
Assigned: 09/31/2016
Due Date: 09/07/2016
This homework will not be counted towards your grade. However, you must turn it in to stay in class.
This homework asks you to do some preliminary readings and solve some simple problems based o
CSE341T
Homework 2
Assigned: 09/21/2015
Due Date: 10/05/2015
In this homework you will design some efcient parallel algorithms using techniques you have
learned, especially, divide and conquer, scan, etc.
Problem 2-1. Closest Pair Problem[55 points]
You h
CSE341T
09/09/2015
MCSS and Sorting
Lecture 5
We will look at another divide and conquer algorithm. Then we start looking at sorting.
1
Maximum contiguous subsequence sum problem (MCSS)
In most divide-and-conquer algorithms you have encountered so far, th
CSE341T
August 24, 2015
Master Method Cheat Sheet
1
Master Method - Formal Version
The Master method applies to many recurrences of the form
n
+ f (n),
b
T (n) = aT
with constants a 1 and b > 1. We assume that there exists some constant n0 such that for a
CSE 341 Parallel and Sequential Algorithms
Homework 1 Solutions
Assigned: 01/23/2013
Due Date: 02/11/2013
This assignment is meant to help you shake off some of the dust from winter break, introduce you
to a few Cilk Plus keywords/concepts, and to familia