CSE 101, Winter 2012
Lecture 2 Notes
Class URL: http://vlsicad.ucsd.edu/courses/cse101-w12/

This ** preview** has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
Participation Exercise, January 12
•
Directions
–
Group yourselves into 2’s or 3’s
–
Write the {names + 4
th
number of your SID} for your group onto ONE
piece of paper
–
Write down one or more proposed algorithms for the following problem
Let E be a sequence of integers x
1
, x
2
, …, x
n
.
A number z is a
majority
in E if it occurs more than
n/2 times in E.
Majority Problem:
Given a sequence of n numbers,
find the majority in the sequence or determine that
none exists.
Example:
<71, 4, 200, 4, 4> has a majority (= 4)
<71, 4, 200, 4 ,4,108> has no majority