History of ClassS04CS141/Hw1

Top | recent changes | Preferences


Revision 18 . . April 17, 2004 6:16 pm by 66-215-226-222.riv-eres.charterpipeline.net
Revision 17 . . April 7, 2004 11:03 am by Neal
  

Difference (from prior major revision) (no other diffs)

Changed: 1,3c1,3
Due Wednesday, April 21 2004 at start of class.
(Place stabled assignment with name, id number, section number, lab number, etc on top of desk
at front of class.)
This homework is due on Wednesday, April 21 2004 at the start of the class.
(Place your stapled assignment with your name, id number, section number, lab number, etc, on top of my desk
at the front of the class.)

Changed: 23c23
twice as large). grow() takes time proportional to the current table_size.
twice as large). The operation grow() takes time proportional to the current table_size.

Changed: 27c27
of half the size. This saves memory.
of half the size. This saves memory. The operation

Changed: 51c51
there is a sequence of N push() and pop() operations that takes time proportional to N2.
there is a sequence of N push() and pop() operations that takes total time proportional to N2.

Changed: 67,68c67,68
operations taking more than O(N) time). Hint: if a the set_size() call does resize the table,
how many push() or pop() operations must have proceeded
operations taking more than O(N) time). Hint: if a set_size() call does grow or shrink the table,
how many push() or pop() operations must have preceded

Changed: 74c74
Recall the UNION-FIND data type discussed in class Friday, week 1 ([/Notes 04 02]?).
Recall the UNION-FIND data type discussed in class on Friday, week 1 ([/Notes 04 02]?).

Changed: 76,78c76,78
In class we discussed a particular implementation of the data type
(also described in Section 4.2.2 of the text), and showed that for that
implementation the time taken to support N UNION or FIND operations
In that class we discussed a particular implementation of the data type
(also described in Section 4.2.2 of the text), and showed that, for that
implementation, the total time taken to support N UNION or FIND operations

Changed: 81c81
Now consider the alternate implementation outlined in section 4.2.3 of the text:
Now, consider the following alternate implementation (also outlined in section 4.2.3 of the text):

Changed: 83,84c83,84
Each set is represented as a tree containing the elements in that set, with
edges directed from each element to its parent in the tree.
Each set is represented as a tree; the nodes of the tree represent the elements in that set.
The tree edges are directed from each node to its parent node in the tree.

Changed: 87,88c87,88
FIND(e) is implemented by tracing the parent pointers from the element
to the root of e's tree and returning the name of the element stored at the root.
FIND(e) is implemented by tracing the parent pointers from the node corresponding to e
to the root of e's tree, and returning the name of the element stored at the root.

Changed: 92c92
set with less elements) to point to the other root (thus making one tree out of two).
set with less elements) so that it points to the root of the other tree (thus making one tree out of two).

Changed: 109,110c109,110
3A. Show that i=1n log i is O(n log n).
It is enough to show that the sum is less than (c n log n) for some constant c.
3A. Show that i=1n log( i) is O(n log n).
Hint: It is enough to show that the sum is less than (c n log n) for some constant c.

Changed: 112,113c112,113
3B. Show that the sum above is Ω(n log n).
It is enough to show that the sum is at least (c n log n) for some constant c > 0.
3B. Show that the sum above is Ω(n log n). Hint:
It is enough to show that the sum is at least (c' n log n) for some constant c' > 0.

Removed: 118,119d117
Note: recall from class that i=0n ci = Θ(cn) for c>1.
This will not be useful for the above exercises.

Top | recent changes | Preferences
Search: