-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinkedListRunner.java
More file actions
39 lines (30 loc) · 915 Bytes
/
Copy pathLinkedListRunner.java
File metadata and controls
39 lines (30 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Name:
Dr. Steinberg
COP3330 Spring 2022
Programming Assignment 5
*/
public class LinkedListRunner
{
public static void main(String []args)
{
LinkedList<String> lst = new LinkedList<String>();
lst.insert("Sonic");
lst.insert("Tails");
lst.insert("Knuckles");
lst.insert("Eggman");
System.out.println(lst.toString());
lst.remove("Eggman");
System.out.println(lst.toString());
lst.clear();
System.out.println(lst.toString());
System.out.println("Creating new list...");
LinkedList<Integer> lst2 = new LinkedList<Integer>();
lst2.insert(0);
lst2.insert(1);
lst2.insert(7, 99);
lst2.insert(5);
lst2.insert(4, 1);
lst2.insert(8, 3);
System.out.println(lst2.toString());
}
}