Write a recursive method that prints out the elements of a linked list in forward order (from the first node to the last).
What will be an ideal response?
```
void printLinkedListFirstToLast( SLNode node ) {
if ( node == null ) return
System.out.println( node.getElement() );
printLinkedList( node.getSuccessor() );
}
void printLinkedListLastToFirst( SLNode node ) {
if ( node == null ) return
printLinkedList( node.getSuccessor() );
System.out.println( node.getElement() );
}
```
Computer Science & Information Technology
You might also like to view...
You show or hide all comments by clicking the ________ button
Fill in the blank(s) with correct word
Computer Science & Information Technology
A password that contains a combination of uppercase and lowercase letters, numbers, and symbols is called a(n) ________ password
Fill in the blank(s) with correct word
Computer Science & Information Technology