Description
Each of the first 10 tasks should have 3 parts-
- Pseudo code/ java code
- Tracing
- Final output
Task 1
Create a Linked List of 6 elements using your nickname. Hint: If your name is John, then the elements should be –
Where,
X = Last 4 digit of your id %4 + Last 3 digit of your id %6 Y = Last 4 digit of your id %5 + Last 3 digit of your id % 9 A = (X+1)_John_(Y+10)
B = (X+2)_John_(Y+20)
C = (X+3)_John_(Y+30)
D = (X+4)_John_(Y+40)
E = (X+5)_John_(Y+50)
F = (X+6)_John_(Y+60)
| Deadline:
1
Task 2
Print the elements in the List. Task 3
Count the number of elements in the List. Task 4
Get an element from the List where an index is given. Index will be (last 3 digit of your ID%5). Task 5
Set an element in the List where an index is given. Index will be (last 3 digit of your ID%4). Task 6
Search an element from the List where an index is given where index will be (last 3 digit of your ID%3).
Task 7
Insert an element in the List in –
- First position
- Last position
- A random position where Index will be (last 3 digit of your ID%5)
Task 8
Remove an element from the list from –
- First position
- Last position
- A random position where Index will be (last 3 digit of your ID%4)
Task 9
Make a reversed copy of the List.
Task 10
Rotate the List –
- To the right by 1 position.
- To the left by 1 position.
2
Task 11
X = Last 3 Digit of your id % 25 + Last 3 digit of your id % 30 + 2 Consider the following structure of singly linked list,
a) Write a code that sorts the linked list and show output/simulation. Then, consider the following code
|
// Remove duplicates from a sorted list Public class LinkedList { Node head; node current = head; while (current != null) { Node temp = current; temp = temp.next; } current.next = temp; current = current.next; } } } |
//Attributes of Node class public class Node { } |
- b) Use the sorted linked list found in Part – a, and simulate each step using the RemoveDuplicate method
- c) Show the resulting list after calling the method.
3




![CSE220 - Lab 04 [CO3] Solved](https://www.logicprohub.com/wp-content/uploads/2023/06/zip.jpeg)