PRG/421 Week 2 Java 2.15 LAB: Inventory (linked lists: insert at the front of a list)

$ 6

PRG/421 Week 2 Java 2.15 LAB: Inventory (linked lists: insert at the front of a list)

Given main() in the Inventory class, define an insertAtFront() method in the InventoryNode class that inserts items at the front of a linked list (after the dummy head node).

Ex. If the input is:
4
plates 100
spoons 200
cups 150
forks 200

the output is:
200 forks
150 cups
200 spoons
100 plates

996 in stock

SKU: PRG421WK2LAB2P15 Category:

Description

PRG/421 Week 2 Java 2.15 LAB: Inventory (linked lists: insert at the front of a list)

Given main() in the Inventory class, define an insertAtFront() method in the InventoryNode class that inserts items at the front of a linked list (after the dummy head node).

Ex. If the input is:
4
plates 100
spoons 200
cups 150
forks 200

the output is:
200 forks
150 cups
200 spoons
100 plates

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.