100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
College aantekeningen

Class notes bachelor in computer application (301) Data Structures using C, ISBN: 9781000470741

Beoordeling
-
Verkocht
-
Pagina's
29
Geüpload op
27-10-2021
Geschreven in
2021/2022

about unit 03 lecture notes in data structures

Instelling
Vak

Voorbeeld van de inhoud

1|Page UNIT-3 DS



UNIT-3 Linked list
A linked list is a sequence of data structures, which are connected together via links.
Linked List is a sequence of links which contains items. Each link contains a
connection to another link. Linked list is the second most-used data structure after
array. Following are the important terms to understand the concept of Linked List.
 Link − Each link of a linked list can store a data called an element.
 Next − Each link of a linked list contains a link to the next link called Next.
 LinkedList − A Linked List contains the connection link to the first link called
First.

Linked List Representation
Linked list can be visualized as a chain of nodes, where every node points to the next
node.




As per the above illustration, following are the important points to be considered.
 Linked List contains a link element called first.
 Each link carries a data field(s) and a link field called next.
 Each link is linked with its next link using its next link.
 Last link carries a link as null to mark the end of the list.

Types of Linked List
Following are the various types of linked list.
 Simple Linked List − Item navigation is forward only.
 Doubly Linked List − Items can be navigated forward and backward.
 Circular Linked List − Last item contains link of the first element as next and
the first element has a link to the last element as previous.

Basic Operations
Following are the basic operations supported by a list.


BY-SONAM TOMAR page-1

,2|Page UNIT-3 DS


 Insertion − Adds an element at the beginning of the list.
 Deletion − Deletes an element at the beginning of the list.
 Display − Displays the complete list.
 Search − Searches an element using the given key.
 Delete − Deletes an element using the given key.

Insertion Operation
Adding a new node in linked list is a more than one step activity. We shall learn this
with diagrams here. First, create a node using the same structure and find the location
where it has to be inserted.




Imagine that we are inserting a node B (NewNode), between A (LeftNode)
and C (RightNode). Then point B.next to C −
NewNode.next −> RightNode;
It should look like this −




Now, the next node at the left should point to the new node.
LeftNode.next −> NewNode;


Algorithm:insertion at given Location:-
o STEP 1: IF PTR = NULL



BY-SONAM TOMAR page-1

, 3|Page UNIT-3 DS


WRITE OVERFLOW
GOTO STEP 12
END OF IF

o STEP 2: SET NEW_NODE = PTR
o STEP 3: NEW_NODE → DATA = VAL
o STEP 4: SET TEMP = HEAD
o STEP 5: SET I = 0
o STEP 6: REPEAT STEP 5 AND 6 UNTIL I<loc< li=""></loc<>
o STEP 7: TEMP = TEMP → NEXT

STEP 8: IF TEMP = NULLWRITE "DESIRED NODE NOT PRESENT"
GOTO STEP 12
END OF IF
END OF LOOP

o STEP 9: PTR → NEXT = TEMP → NEXT
o STEP 10: TEMP → NEXT = PTR
o STEP 11: SET PTR = NEW_NODE
o STEP 12: EXIT

o

o




o #include<stdio.h>
o #include<stdlib.h>
o void randominsert(int);




BY-SONAM TOMAR page-1

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
27 oktober 2021
Aantal pagina's
29
Geschreven in
2021/2022
Type
College aantekeningen
Docent(en)
S tom
Bevat
Alle colleges

Onderwerpen

€6,98
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
sumitkumarsingh10211

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
sumitkumarsingh10211 meerut institute of Technology
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
4 jaar
Aantal volgers
1
Documenten
39
Laatst verkocht
4 jaar geleden

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen