Honor Code Acknowledgment: ___________________
Describe what the function Chop, shown below, does
to the parameter list (assume list is a "standard"
struct for implementing linked lists of integers).
The call Prepend(list,7) should add a node with 7 as the info
field as the first node of list.
Consider a list of integers in which the integers are stored in
non-decreasing order and in which the integer k occurs exactly
k times; these lists are called N-lists where
N is the largest integer in the list. For example, a 4-list is
(1,2,2,3,3,3,4,4,4,4) and a five list is a 4-list with (5,5,5,5,5)
appended to the end.
Using big-Oh notation (in terms of N) what is the number of elements in
an N-list? Justify your answer briefly.
If all occurrences of numbers less than
Problem 1 Spivey's Corners: (2 points)
Problem 2: Big Fix (4 points)
What is the value of the following postfix expressions?
8 5 + 3 2 * - 7 *
and
22 8 12 7 + * - 10 /
Problem 3: Circle of Friends (4 points)
In a circularly linked list, the last node points at the first node
(instead of at 0). Access to the list is via a pointer to the last
node, since the first node is easy to get to from the last node.
Write a function Prepend that adds a new node as the first node
of a non-empty, circularly linked list. For an extra point deal with
an empty list too.
Problem 4: Jouez Hautbois (4 points)
Part A
Part B