0% found this document useful (0 votes)
12 views16 pages

2023F BSE 027 (Lab 07)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views16 pages

2023F BSE 027 (Lab 07)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Lab#07

Lab Task
1. Write a program that can store 10 records of students in a link list manner and apply the following operations
on it.
a. View the list
b. Insert the elements in different locations of linked list and view it.
c. Search any element from the linked list
d. Delete record again view the list after deletion.

Code:-
Output:-
2. Write a java program to merge two equal linkedlists using runner technique.

Code:-

Output:-
3. Write a program to check whether the linkedlist is empty or not.

Code:-

Output:-
4. You are managing a list of integers in a class, and you need to implement a Singly Linked List with the
following operations:

a) Insert an integer at the beginning of the list.


b) Display the list.
c) Find the middle element of the list. If the list has an even number of elements, return the first middle
element.

Code:-
Output:-

Home Task:-
1. Write a program that reads the name, age and salary of 10 persons and perform the
following operations on it.
a. Insert the elements in different locations of linked list and view it.
b. Delete record and again view the list after deletion.

Code:-
Output:-
2. You are tasked with managing a list of students' roll numbers in a class. Initially, the list is empty. You
have to implement a Singly Linked List with the following operations:

a) Add student roll number at the end of the list.


b) Delete a student by roll number.
c) Display the roll numbers of all students in the class

Code:-
Output:-

3. You are managing two singly linked lists representing two groups of students. Your task is to:

a) Append the second list to the first list (i.e., add all elements of the second list to the end of the first list).
b) Count the number of students in the final list (i.e., the total number of nodes in the list).
c) Display the final list after the append operation.

Code:-
Output:-

You might also like