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...

A Waterfall View on a spectrum analyzer shows the aggregate energy collected since the start of a session.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

PowerPoint allows you to change the thickness of a WordArt outline in ____ increments.

A. one-half-point B. one-fourth-point C. three-quarter-point D. one-point

Computer Science & Information Technology

What two optical disc drive standards allow for rewritable discs?

A. DVD-ROM B. DVD-RAM C. BD-ROM D. BD-RE

Computer Science & Information Technology

A(n) ____ website offers an interactive and engaging environment and may contain music, video, sports, games, and other similar features.

A. entertainment B. portal C. news D. advocacy

Computer Science & Information Technology