0% found this document useful (0 votes)
25 views14 pages

Linked - List

The document outlines a course on Elementary Data Structure Using C++ with a focus on linked lists, including course objectives and outcomes. It details operations such as inserting and deleting nodes in a linked list, compares linked lists with arrays, and discusses applications and complexities. Additionally, it provides references for further reading on linked lists.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views14 pages

Linked - List

The document outlines a course on Elementary Data Structure Using C++ with a focus on linked lists, including course objectives and outcomes. It details operations such as inserting and deleting nodes in a linked list, compares linked lists with arrays, and discusses applications and complexities. Additionally, it provides references for further reading on linked lists.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

INSTITUTE - UIE

DEPARTMENT- ACADEMIC UNITS


Bachelor of Engineering (Computer Science & Engineering)
Subject Name: Elementary Data Structure Using C++
Code:23CSH-103

LINKED LIST DISCOVER . LEARN . EMPOWER


Elementary Data
Structure Using C++

Course Objectives

• To enable the students to understand


various stages and constructs of C++
programming language.
• To improve their ability to analyze and
address variety of problems in C++.
• To understand the concept of data
structures and various operations on
them.
• To understand the properties of
various data structures and able to
identify the strengths and weaknesses
of different data structures.
• To analyze and compare the efficiency
of algorithms and learn to design
2
efficient algorithms for solving
Course Outcomes
CO Course Outcome
Number

CO1 Understand the concepts of object-oriented programming including


programming process and compilation process.
CO2 Apply different techniques to decompose a problem and
programmed a solution with various concepts of object-oriented
programming language.
CO3 Analyse and explain the behaviour of linear data structure
operations using the programming addressed in the course.
CO4 Implement and evaluate the programs using the syntax and
semantics of object-oriented programming.
CO5 Design the solution of real-world problems in order to determine
that the program performs as expected.

3
Scheme of Evaluation

4
• A linked list is a linear data structure, in
which the elements are not stored at
contiguous memory locations.
Link List

A rundown executed by every thing having a


connection to the following thing.
Every hub comprises of its own information
and the location of the following hub and https://www.geeksforgeeks.org/data-structures/linked-list/
structures a chain.
Connected Lists are utilized to make trees
and charts.

5
ARRAYS VS • Arrays and Linked Lists both are direct
information structures, yet the two of them
LINK LISTS have a few points of interest and drawbacks
over one another.

A rundown executed by every thing having a


connection to the following thing.
Every hub comprises of its own information
and the location of the following hub and
structures a chain.
Connected Lists are utilized to make trees
and charts.
https://www.google.com/search?biw=1600&bih=789&tbm=isch
&sa=1&ei=Ujn6XJKvFPLXz7sP6fCQgAk&q=ARRAYS+VS+LINKLISTS
&oq=ARRAYS+VS+LINKLISTS&gs_l=img.12...264094.264094..2666
65...0.0..0.148.148.0j1......0....2j1..gws-wiz-img.A9FVRjK-qiY#imgr
c=t1853XlC8zYF9M:

6
INSERTING AT BEGINNING OF THE LIST

Lets START is the pointer having the initial position in linked list.
Let data be the element to be inserted in the new node.
POS is the mark where the new node is to be inserted.
TEMP is a temporary pointer to hold the node address.
1. Input data
2. Develop a New Node
3. New Node → DATA = data
4. New Node → Next = NULL
5. If (START equal to NULL)
then START = New Node.

7
INSERT A NODE AT THE END
Begin
1. Input DATA
2. develop a New Node
3. New Node → DATA = DATA
4. New Node → Next = NULL
5. If (START equal to NULL)
(a) START = New Node
6. Else
(a) TEMP = START
(b) While (TEMP → Next not equal to NULL)
(i) TEMP = TEMP → Next
7. TEMP → Next = New Node
Exit

8
DELETION

• In order to delete FIRST node from linked list we have to consider three possibilities:

(1) List is Empty (START = NULL). In this case we can not delete node from linked list.

(2) There is only one node in the linked list


(START->LINK=NULL). In this case we can delete the first node and then linked list becomes empty (START=NULL).

(3) There are more then one nodes in the linked list. In this case we can delete the first node.
After deleting the first node we have to move FIRST pointer to next node so that it can points to the newly first node in
the linked list.

9
DELETION

• In order to delete FIRST node from linked list we have to consider three possibilities:

(1) List is Empty (START = NULL). In this case we can not delete node from linked list.

(2) There is only one node in the linked list


(START->LINK=NULL). In this case we can delete the first node and then linked list becomes empty (START=NULL).

(3) There are more then one nodes in the linked list. In this case we can delete the first node.
After deleting the first node we have to move FIRST pointer to next node so that it can points to the newly first node in
the linked list.

10
FAQ

1. What is the complexity of search operation in linked list?


2. How linked list is better than array?
3. In what cases link lists give worst results?

11
APPLICATION OF LINK LIST
• Pre-characterized number of classifications suggests that we can utilize a basic static structure like
cluster to speak to the classes. Since we don't have the foggiest idea about the quantity of things
in every class, we can speak to things in every classification utilizing a connected rundown. So
what we need is a variety of connected records
• You can likewise consider speaking to a web list utilizing a variety of connected records, where
exhibit contains the catchphrases and connected records contains the web URL's the place that
watchword happens.

12
REFERENCES
• https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/linked%20lists.html
• https://www.geeksforgeeks.org/data-structures/linked-list/
• https://www.tutorialspoint.com/data_structures_algorithms/linked_list_algorithms.htm
• https://www.geeksforgeeks.org/merge-two-sorted-lists-place/
• https://www.geeksforgeeks.org/reverse-a-linked-list/

13
THANK YOU

You might also like