The general presentation of your document counts! (This includes qualities such as neatness, formatting, and legibility.)
Hint: you'll need three pointers to do this ``on the fly''.
struct Node {
int val;
struct Node *next;
};
void llPrint(struct Node *np)
{
while(np) {
cout << np->val << "\n";
np = np->next;
}
}
Enter ll size: 5 0 1 2 3 4
Enter ll size: 5 4 3 2 1 0Hint: use the following function prototype:
void llReverse(struct Node **np);