Lists Practice Assignments

Overview

Linear structures (for example, lists, stacks and queues) are common in everyday life and prevelant through programs, including operating systems.

Submission Instructions

Submit each of the following practice assignments at codePost.io.
To register for a free codePost account, please follow these instructions.
Watch this short video for a demonstration of submitting an assignment and reviewing the results:
YouTube video: codePost: Submission and Checking Results Thumbnail
Note, currently, feedback is not visible in Safari.

Practice Assignments

Array-Based Lists

Write Java code in a new driver class that uses an array-based list to complete the following:

Use the List interface and the AList class for this assignment. Also, add a toString method into the AList class that returns a sequence representation of the list. Do not change the interface and you do not need to make any other adjustments to the class. Note, you do not need to upload List.java.

Examples

Note, user input is in bold face blue and underlined text is required for test cases.
Please enter the number of characters for your first name, a space, your middle initial (and a '.'), a space and your last name: 12
You entered 12
Please enter your first name: Joe
You entered Joe
Just the first name: ⟨ | J, o, e ⟩
Please enter your last name: Biden
You entered Biden
With first and last names:  ⟨ | J, o, e,  , B, i, d, e, n ⟩
Please enter just your middle initial: R
You entered R
Full name: ⟨ J, o, e,  | R, .,  , B, i, d, e, nJust initials: ⟨ J, R, B | ⟩
Please enter the number of characters for your first name, a space, your middle initial (and a '.'), a space and your last name: 15
You entered 15
Please enter your first name: Grace
You entered Grace
Just the first name: ⟨ | G, r, a, c, e ⟩
Please enter your last name: Hopper
You entered Hopper
With first and last names:  ⟨ | G, r, a, c, e,  , H, o, p, p, e, r ⟩
Please enter just your middle initial: B
You entered B
Full name: ⟨ G, r, a, c, e,  | B, .,  , H, o, p, p, e, rJust initials: ⟨ G, B, H | ⟩
Please enter the number of characters for your first name, a space, your middle initial (and a '.'), a space and your last name: 20
You entered 20
Please enter your first name: Katherine
You entered Katherine
Just the first name: ⟨ | K, a, t, h, e, r, i, n, e ⟩
Please enter your last name: Johnson
You entered Johnson
With first and last names:  ⟨ | K, a, t, h, e, r, i, n, e,  , J, o, h, n, s, o, n ⟩
Please enter just your middle initial: ?
You entered ?
Full name: ⟨ K, a, t, h, e, r, i, n, e,  | ?, .,  , J, o, h, n, s, o, nJust initials: ⟨ K, ?, J | ⟩

Linked Lists

Write Java code in a new driver class that uses an linked list to complete the following:

Use the List interface, Link class and the LList class for this assignment. Also, add a toString method into the LList class that returns a sequence representation of the list. Do not change the interface and you do not need to make any other adjustments to the class. Note, you do not need to upload List.java, nor Link.java.

Examples

Note, user input is in bold face blue and underlined text is required for test cases.
Please enter your first name: Joe
You entered Joe
Just the first name: ⟨| J, o, e ⟩
Please enter your last name: Biden
You entered Biden
With first and last names:  ⟨| J, o, e,  , B, i, d, e, n ⟩
Please enter just your middle initial: R
You entered R
Full name: ⟨J, o, e,  | R, .,  , B, i, d, e, nJust initials: ⟨J, R, B | ⟩
Please enter your first name: Grace
You entered Grace
Just the first name: ⟨| G, r, a, c, e ⟩
Please enter your last name: Hopper
You entered Hopper
With first and last names:  ⟨| G, r, a, c, e,  , H, o, p, p, e, r ⟩
Please enter just your middle initial: B
You entered B
Full name: ⟨G, r, a, c, e,  | B, .,  , H, o, p, p, e, rJust initials: ⟨G, B, H | ⟩
Please enter your first name: Katherine
You entered Katherine
Just the first name: ⟨| K, a, t, h, e, r, i, n, e ⟩
Please enter your last name: Johnson
You entered Johnson
With first and last names:  ⟨| K, a, t, h, e, r, i, n, e,  , J, o, h, n, s, o, n ⟩
Please enter just your middle initial: ?
You entered ?
Full name: ⟨K, a, t, h, e, r, i, n, e,  | ?, .,  , J, o, h, n, s, o, nJust initials: ⟨K, ?, J | ⟩