

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Node
The Node class is:
template
The new list will contain high-low+1 nodes, which are copies of the values in the nodes occupying positions low up through and including high of the list pointed to by head. The function should return the pointer to the first node in the new list. For example, in the following drawing the original list is shown on top and the new list created by the function when low==2 and high==4 is shown below.
New list
head 3.1 2.4 8.7 9.
nhead 2.4 8.7 9.
14.2 0.
Original list
A pointer to the first node of this new list should be returned. (In the drawing this would be the value of nhead.) You may assume the original list contains at least low nodes. If it contains fewer than high nodes, then stop copying at the end of the original list.
void insert_in_order(double x, queue
You may only use the public queue interface (member functions) as specified in lab. You may use a second queue as local variable scratch space or you may try to do it in a single queue (which is a bit harder). Give an “O” estimate of the number of operations required by this function.
template
The function must NOT create ANY new nodes.