The document provides lecture notes on linked lists and their operations. It contains the following information:
- An overview of linked lists including their memory representation using nodes with a data field and pointer to the next node.
- The main operations on linked lists - traversing, searching, inserting nodes at the start, end or a specified location, and deleting nodes from the start, end or a specified location.
- Details on implementing these operations in C++ including code examples for inserting, deleting and searching nodes in a linked list.
- Advantages of linked lists like flexibility in memory allocation and efficient operations like splitting and joining lists.
This is a presentation on Linked Lists, one of the most important topics on Data Structures and algorithms. Anyone who is new to DSA or wants to have a theoretical understanding of the same can refer to it :D
This tutorial explains about linked List concept. it contains types of linked list also. All possible graphical representations are included for better understanding.
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARBHARATH KUMAR
Basic Terminology: Elementary Data Organization:
Data Structures Usage
Data Structures Implementation
CLASSIFICATION OF DATA STRUCTURES
DATA STRUCTURES OPERATIONS
Space-Time Trade-off
Searching Algorithms
This is a presentation on Linked Lists, one of the most important topics on Data Structures and algorithms. Anyone who is new to DSA or wants to have a theoretical understanding of the same can refer to it :D
This tutorial explains about linked List concept. it contains types of linked list also. All possible graphical representations are included for better understanding.
Introduction of Data Structures and Algorithms by GOWRU BHARATH KUMARBHARATH KUMAR
Basic Terminology: Elementary Data Organization:
Data Structures Usage
Data Structures Implementation
CLASSIFICATION OF DATA STRUCTURES
DATA STRUCTURES OPERATIONS
Space-Time Trade-off
Searching Algorithms
What is Link list? explained with animationsPratikNaik41
This Presentation expalins what are data structures and linked lists with animations.
It also contains a sample implementation of Linked List using C++language.
It uses C++ Pointers to define linked lists.
DATA STRUCUTRES AND LINKED LIST
WHAT ARE DATA STRUCTURES?
Classification Of Data Structures ?
WHAT IS LINKED LIST?
WHY USE LINKED LIST?
INSERTION AND DELETION IN LINKED LIST
LINKED LIST CODE
This PPT is about "Double Linked List" concept of Data Structure and Algorithm. It is very informatively describe its each concept with example and also pros and cons..
If anyone has Question related to this they may ask freely.
:)
YouTube Link: https://youtu.be/giJimUEkI7U
**Java, J2EE & SOA Certification Training - https://www.edureka.co/java-j2ee-training-course **
This Edureka PPT will provide you with detailed knowledge about Linked Lists in Java and along with it, This PPT will also cover some examples of Linked Lists in Java, in order to provide you with a deep understanding of their functionality. This PPT will cover the following topics:
What is a Linked List?
Types of Linked Lists
Features of Linked Lists
Methods in Linked Lists
Array v/s Linked List
Complete Java Playlist: http://bit.ly/2XcYNH5
Complete Blog Series: http://bit.ly/2YoabkT
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Data Structure is the specific method for sorting out the data in a system with the goal that it could be utilized efficiently. These can implement at least one specific abstract data types (ADT), which indicate the operations that can be performed on the data structure and the computational unpredictability of those operations. Copy the link given below and paste it in new browser window to get more information on Data Structure & Algorithms:- www.transtutors.com/homework-help/computer-science/data-structure-and-algorithms.aspx
In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data. https://apkleet.com
<a href="https://apkleet.com" >games apk </a>
What is Link list? explained with animationsPratikNaik41
This Presentation expalins what are data structures and linked lists with animations.
It also contains a sample implementation of Linked List using C++language.
It uses C++ Pointers to define linked lists.
DATA STRUCUTRES AND LINKED LIST
WHAT ARE DATA STRUCTURES?
Classification Of Data Structures ?
WHAT IS LINKED LIST?
WHY USE LINKED LIST?
INSERTION AND DELETION IN LINKED LIST
LINKED LIST CODE
This PPT is about "Double Linked List" concept of Data Structure and Algorithm. It is very informatively describe its each concept with example and also pros and cons..
If anyone has Question related to this they may ask freely.
:)
YouTube Link: https://youtu.be/giJimUEkI7U
**Java, J2EE & SOA Certification Training - https://www.edureka.co/java-j2ee-training-course **
This Edureka PPT will provide you with detailed knowledge about Linked Lists in Java and along with it, This PPT will also cover some examples of Linked Lists in Java, in order to provide you with a deep understanding of their functionality. This PPT will cover the following topics:
What is a Linked List?
Types of Linked Lists
Features of Linked Lists
Methods in Linked Lists
Array v/s Linked List
Complete Java Playlist: http://bit.ly/2XcYNH5
Complete Blog Series: http://bit.ly/2YoabkT
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Data Structure is the specific method for sorting out the data in a system with the goal that it could be utilized efficiently. These can implement at least one specific abstract data types (ADT), which indicate the operations that can be performed on the data structure and the computational unpredictability of those operations. Copy the link given below and paste it in new browser window to get more information on Data Structure & Algorithms:- www.transtutors.com/homework-help/computer-science/data-structure-and-algorithms.aspx
In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data. https://apkleet.com
<a href="https://apkleet.com" >games apk </a>
A MAN’S RIGHT TO HAPPINESS If by happenstance you require emergency triage, Maybury recom- mends that you transform your image as much as possible to that of a health care provider.He means that doctors and nurses are social beings that will gravitate more quickly and attentively to those with whom they identify the most.Therefore,if you dress intelligently,sound highly educated, act very polite and courteous, and perhaps carry a book with you,health care providers may feel more inclined to pay more attention to you and provide better care. This is the kind of mindset you’ll need in the new Obamacare
What is DSA ?
What are different types of data structures ?
Primitive and Non Primitive DSA
Arrays
Queue
Stack
Linked List
Memory representation of Linked Lists
Static arrays are structures whose size is fixed at compile time and.pdfanjanacottonmills
Static arrays are structures whose size is fixed at compile time and therefore cannot be extended
or reduced to fit the data set. A dynamic array can be extended by doubling the size but there is
overhead associated with the operation of copying old data and freeing the memory associated
with the old data structure. One potential problem of using arrays for storing data is that arrays
require a contiguous block of memory which may not be available, if the requested contiguous
block is too large. However the advantages of using arrays are that each element in the array can
be accessed very efficiently using an index. However, for applications that can be better
managed without using contiguous memory we define a concept called “linked lists”.
A linked list is a collection of objects linked together by references from one object to another
object. By convention these objects are named as nodes. So the basic linked list is collection of
nodes where each node contains one or more data fields AND a reference to the next node. The
last node points to a NULL reference to indicate the end of the list.
Types of Linked Lists
Linked lists are widely used in many applications because of the flexibility it provides. Unlike
arrays that are dynamically assigned, linked lists do not require memory from a contiguous
block. This makes it very appealing to store data in a linked list, when the data set is large or
device (eg: PDA) has limited memory. One of the disadvantages of linked lists is that they are
not random accessed like arrays. To find information in a linked list one must start from the head
of the list and traverse the list sequentially until it finds (or not find) the node. Another advantage
of linked lists over arrays is that when a node is inserted or deleted, there is no need to “adjust”
the array.
There are few different types of linked lists. A singly linked list as described above provides
access to the list from the head node. Traversal is allowed only one way and there is no going
back. A doubly linked list is a list that has two references, one to the next node and another to
previous node. Doubly linked list also starts from head node, but provide access both ways. That
is one can traverse forward or backward from any node. A multilinked list (see figures 1 & 2) is
a more general linked list with multiple links from nodes. For examples, we can define a Node
that has two references, age pointer and a name pointer. With this structure it is possible to
maintain a single list, where if we follow the name pointer we can traverse the list in alphabetical
order of names and if we traverse the age pointer, we can traverse the list sorted by ages. This
type of node organization may be useful for maintaining a customer list in a bank where same
list can be traversed in any order (name, age, or any other criteria) based on the need.
Designing the Node of a Linked List
Linked list is a collection of linked nodes. A node is a struct with at least a.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
2024.06.01 Introducing a competency framework for languag learning materials ...
Link list
1. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 1/10
Lecture 4 to 5
Contents
• Linked List
• Memory Representation
• Operations on Linked List
• Traversing
• Searching
• Insertion
o Node Insertion At Start
o Node Insertion At End
o Node Insertion after a specified location
• Deletion
o Deletion of first node
o Deletion of last Node
o Deletion of a specified Node
• Count number of Node
• Insert a new Node as tenth Node
• Delete tenth Node
• Advantages of Link list
• Disadvantages of Link list
Linked List
This is most widely used data structure and also very much practical one. Here the elements
(nodes) are kept in disjoint memory locations. Each node consists of two parts one for the data
and other for address of next node. In array approach which is hardly used but just to clarify the
concept. One might be kept for data portion and second for maintaining the appropriate address
to next node. As shown in figure below.
2. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 2/10
1 W 5
2 S 3
3 I 4
4 F NULL
5 A 2
But this does not reveal the actual meaning of linked list so we go for a pointer approach. Let
us consider the operations of insertion and deletion in a sequentially allocated list. Assume that
we have an n-element list and that it is required to insert a new element between the second and
the third elements. In this case, the last n – 2 elements of the list must be physically moved to
make room for the new element. For large-sized lists, which are subjected to many insertions,
this insertion approach can be very costly. The same conclusion holds in the case of deletion,
since all elements after the deleted element must be moved up so as to use the vacated space
caused by the deletion.
These two allocation methods (linked and sequential) can be compared with respect to
other operations as well. For a search operation in a linked list, we must follow the link from the
first node onwards until the desired node is found. This operation is certainly inferior to the
computed-address method of locating an element in a sequentially allocated list. If we want to
split or join two linked lists, then these operations involve the changing of pointer fields without
having to move any nodes. Such is not the case for sequentially allocated counterparts.
Clearly, pointers or links consume additional memory. The cost of this additional memory
becomes less important as the information contents of a node require more memory. In the above
discussion the actual address of a node was used in the link field for illustration purposes. In
practice, however, this address may be of no concern (and indeed unknown) to the programmer.
Therefore, in the remainder of our discussion of linked structure, the arrow symbol is used
exclusively to denote a successor node.
The use of pointers is only to specify the relationship of logical adjacency among
elements of a linear list. This is an important point to emphasize – the notion of logical adjacency
versus physical adjacency. In vector (or sequential) storage, they are the same. In linked storage,
they are not. Therefore, we have more flexibility with linked storage.
3. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 3/10
Memory Representation
A linked list provides a more flexible storage system in that it doesn’t use array at all.
Instead, space for each data item is obtained as needed with new, and each item is connected or
linked, to the next data item using a pointer. The individual item don’t need to be located in the
memory contiguously, the way arrays are; they can be scattered anywhere.
struct link { // node of list
int data; //data item
link* next; //pointer to next link
};
// class of Linked List
class linklist { //a linked list
private:
link* first; //pointer to first link
public:
linklist() //no‐argument constructor
{ first = NULL; } //no first link
};
Operations on Linked List
Following are the major operations on linked lists.
1. Traversing
Following C++ code is used to traverse a linked list.
void linklist::display() { //display all links
link* current = first; //set ptr to first link
while( current != NULL ) { //quit on last link
cout << current‐>data << endl; //print data
current = current‐>next; //move to next link
}
}
2. Searching
Following C++ code is used to traverse a linked list.
4. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 4/10
void linklist::search(int d) { //display all links
if (first == NULL) {
cout << “List is empty”;
return;
}
int loc=0;
link* current = first; //set ptr to first link
while( current != NULL ) { //quit on last link
if (current‐>data == d) {
cout << “Item found” << endl;
loc=1;
}
current = current‐>next;
}
if (loc == 0)
cout << “Item not found”;
}
3. Insertion
A new node can be inserted in the following ways.
3.1 Node Insertion At Start
Following code inserts a new node at the start of linked list.
void linklist::InsertAtStart(int d) { //add data item
link* newlink = new link; //make a new link
newlink‐>data = d; //give it data
newlink‐>next = first;
first = newlink;
}
The given C++ program executes insertion at start.
int main() {
linklist li; //make linked list
li.InsertAtStart(25); //add four items to list
li. InsertAtStart (36);
li. InsertAtStart (49);
li.display();
}
5. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 5/10
3.2 Node Insertion At End
This approach is simpler it is used for insertion at end.
void linklist::InsertAtEnd(int d) { //add data item
link* newlink = new link; //make a new link
newlink‐>data = d; //give it data
newlink‐>next = NULL;
if (first == NULL) {
first = newlink;
}
else {
link *current = first;
while (current‐>next != NULL)
current = current‐>next;
current‐>next = newlink; //now first points to this
}
}
25 NULL
25 NULL36 &25
25 NULL 36 &2549 &36
25 NULL 36 &2549 NUL
Insertion at start
(Head)
Deletion at start
(Head)
6. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 6/10
3.3 Node Insertion after a specified location
Following C++ code is used to insert new node after a specified node of a linked list.
void linklist::InsertAtLoc(int n, int d) { //display all links
if (first == NULL) {
cout << “List is empty”;
return;
}
int loc=0;
link* current = first; //set ptr to first link
while( current != NULL ) { //quit on last link
if (current‐>data == d) {
link* newlink = new link;
newlink‐>data = n;
newlink‐>next = current‐>next;
current‐>next = newlink;
loc=1;
}
current = current‐>next;
}
if (loc == 0)
cout << “Item not found”;
}
4. Deletion
A new node can be deleted in the following ways.
4.1 Deletion of first node
Following code deletes a node at the start of linked list.
7. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 7/10
void linklist::DeleteAtStart() { //add data item
if (first == NULL) {
cout << “Unable to delete List is empty”;
return;
}
link* temp = first; //save first in a new link
first = first‐>next;
temp‐>next = NULL;
delete temp;
}
4.2 Deletion of last Node
Following code deletes a node at the end of linked list.
void linklist::DeleteAtEnd() { //add data item
if (first == NULL) {
cout << “Unable to delete List is empty”;
return;
}
if (first‐>next == NULL) { // if there is one node in link list
link* temp = first; //save first in a new link
first = first‐>next;
temp‐>next = NULL;
delete temp;
} else { // for more than 1 nodes existing in a list
link* temp=NULL, *current=first;
while (current‐>next !=NULL) {
temp=current;
current = current‐>next;
}
temp‐>next = NULL;
delete current;
}
}
4.3 Deletion of a specified Node
Following C++ code is used to delete a specified node in a linked list.
8. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 8/10
void linklist::DeleteAtLoc(int d) { //display all links
if (first == NULL) {
cout << “Unable to delete List is empty”;
return;
}
int loc=0;
link* temp=NULL, *current=first;
while( current != NULL ) { //quit on last link
if (current‐>data == d) {
if (current == first) { // if desired data is on first node
Link *t = first;
first = first‐>next;
t‐>next =NULL;
delete t;
} else { // if desired data is on any other node
temp‐>next = current‐>next;
current‐>next = NULL;
delete current;
current =temp‐>next;
loc=1;
}
}
temp=current;
current = current‐>next;
}
if (loc == 0)
cout << “Item not found”;
}
5. Count number of Node
Following C++ code is used to count the number of nodes in a linked list.
void linklist::CountNodes() { //display all links
link* current = first; //set ptr to first link
int n=0;
while( current != NULL ) { //quit on last link
n++;
current = current‐>next; //move to next link
}
cout << “Number of nodes = ” << n;
}
9. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 9/10
6. Insert a new Node as tenth Node
Following C++ code is used to insert a new node as tenth node in a linked list.
void linklist::Insert10thNodes() { //display all links
if (first == NULL) {
cout << “List is empty”;
return;
}
link* current = first; //set ptr to first link
int n=0;
while( current != NULL ) { //quit on last link
n++;
if (n == 9) {
link* newlink = new link;
newlink‐>data = n;
newlink‐>next = current‐>next;
current‐>next = newlink;
break;
}
current = current‐>next; //move to next link
}
}
7. Delete tenth Node
Following C++ code is used to delete tenth node in a linked list.
void linklist::Delete10thNodes() { //display all links
if (first == NULL) {
cout << “List is empty”;
return;
}
link* current = first *temp=NULL; //set ptr to first link
int n=0;
while( current != NULL ) { //quit on last link
n++;
if (n == 10) {
temp‐>next = current‐>next;
current‐>next = NULL;
delete current;
break;
}
temp = current;
current = current‐>next; //move to next link
}
}
10. Lecture Notes Data Structures and Algorithms
Maryam Amin, Assistant Professor, BIIT 10/10
Advantages of Link list
Following are the major advantages of link list.
• No contiguous memory is required.
• No wastage of memory
• Efficient insertion and deletion of data elements
Disadvantages of Link list
Following are the major disadvantages of link list.
• It is not easy to access an element directly.
• It is not efficient in searching and sorting