The general presentation of your document counts! (This includes qualities such as neatness, formatting, and legibility.)
fadd
: add node to front
eadd
: add node to end
fdel
: remove and return node from front
edel
: remove and return node from end
fnext
: return first/next node after given node
lprev
: return last/prev node before given node
fprint
: print list forwards
bprint
: print list backwards
fnext
, lprev
member functions
return the first/last nodes, respectively, if the provided
argument is a pointer to the head node.
// create linked list
for(int i=0; i < nums; i++) {
qnode = new QNode(i);
qhead->eadd(qnode);
}
then printing the list frontwards and backwards, and finally
removing nodes from either the front or back of the list.
Enter ll size: 4 Printing forwards: 0 1 2 3 Printing backwards: 3 2 1 0 Removing from front: 0 1 2 3 queue empty