JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Categories: C Language in hindi

Linked Lists in hindi in c language , what is Linked Lists in c , c भाषा में लिंक्ड लिस्ट क्या है हिंदी में

c भाषा में लिंक्ड लिस्ट क्या है हिंदी में Linked Lists in hindi in c language , what is Linked Lists in c :-
हमने इससे पहले के article मे सभी data type को स्टूडे किया अब आने वाले article मे कुछ advanced data structure जैसे linked list,stack और queues को पढेगे |
जिसे की array भी एक लिस्ट है |array मे ,data को sequential collection है जिसमे data को index से accessing और manipulation का सकते है |लेकिन अर्रा में ,array की size को compile time पर declare करना होता है |जो की कई बार मुश्किल हो जाता है |इस प्रॉब्लम को solve करने के लिए एक नए data structure को introduce किया गया है |
Linked List
linked list एक एसी data structure है जिसमे data structure के item के अलावा lost मे आने वाले next item के address को contain किया जाता है |इस data structure को linked list इसलिए कहते है क्योकि इसमे list के सभी item आने वाले item से link होते है |
linked लिस्ट के प्रत्येक block को नोड कहते है |जिसके दो part होते है :-
1.पहले भाग linked लिस्ट के item को रखता है |
2.दुसरे भाग मे ,next item के address को रखता है |

इस data structure मे element , memory address से link नहीं होते है बल्कि किसी लॉजिकल लिंक से लिंक होते है जो की सभी नोड के दुसरे भाग मे store होता है |लिंक एक pointer variable होता है जिसका type दुसरे नोड के data type का होता है |linked लिस्ट को structure data type से define किया जाता है जिसका syntax है :-

struct node
{
int item;
struct node *next ;
};
इस syntax मे :-
1. item : item एक integer variable है जो की linked लिस्ट के element को रखता है |
2. next : next एक pointer variable है जो की linked लिस्ट के next element के address को contain करता है |इसका data type struct node होता है |
इस तरह की structure जो की members फ़ील्ड मे एसे member को रखते है जिसका data type ,खुद का data type होता है |ये structure self referential structure कहते है |
किसी नोड का syntax होता है :-
struct node
{
mem 1;
mem 2;
……….;
……….;
struct node *pointer_name ;
};
एक उदाहरन लेते है :-
struct node
{
int salary;
struct node *n;
};
ये एक linked list के node का declartion है |अब उसके बाद ,node1 और node2 दो नोड है जिसका data type struct node है |
इसे declare करेगे :-
struct node node1 ,node2 ;
इस statement से दो space create हो जायेगे जिसमे से एक space पहले node के item को और दुसरे node के address को contain करेगा |और दूसरा node ,दुसरे node का  item को तीरसे node के address को contain करता है |
अतः node1.n=&node2; अगला statement होगा जो की linked लिस्ट  की condition को follow करता है |
उसके बाद :
node1.salary=2000;
node2.salary=4500;
इन statement से , दो node के item वाले space मे 2000 और 4500 assign हो जायेगा |
अगर इस लिस्ट मे अगला node add होगा तब node2.n=&node3; statement से node3 का address node2 के pointer variable मे store हो जाता है |
अगर किसी लिस्ट का end हो जाता है  इस लिस्ट के last वाले element के pointer variable मे null pointer ‘0’ को store होता है | अतः node2.n=0;
किसी linked लिस्ट के element को access करने के लिए printf(“%d”,node1.n->salary); use कर सकते है |
Linked list : advantage और disadvantage :-
1.लिंक लिस्ट एक dynamic data type है इसे प्रोग्राम के run time के समय declare किया जा सकता है |मतलब इसके size को कम और ज्यादा run time के समय किया जा सकता है |
2.इस डट type से memory wastage नहीं होती है |ये memory को तभी use करता है जब इसे उसकी जरुरत होती है |अनावश्यक memory को होल्ड नहीं करता है |
3.सबसे महत्वपूर्ण advantage होता है की linked list की flexibility |इसका मतलब है की linked लिस्ट के किसी भी element को कभी भी rearrange कर सकते है |
Disadvantage
1,linked लिस्ट की सबसे पहले disadvantage है की item के random access complex और time consuming होता है |
2.अगर हम fixed length linked list को use करते है linked list सेअच्छा array होती है क्योकि linked लिस्ट से data को process करना मुश्किल होता है |
Sbistudy

Recent Posts

सती रासो किसकी रचना है , sati raso ke rachnakar kaun hai in hindi , सती रासो के लेखक कौन है

सती रासो के लेखक कौन है सती रासो किसकी रचना है , sati raso ke…

1 day ago

मारवाड़ रा परगना री विगत किसकी रचना है , marwar ra pargana ri vigat ke lekhak kaun the

marwar ra pargana ri vigat ke lekhak kaun the मारवाड़ रा परगना री विगत किसकी…

1 day ago

राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए sources of rajasthan history in hindi

sources of rajasthan history in hindi राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए…

3 days ago

गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है ? gurjaratra pradesh in rajasthan in hindi

gurjaratra pradesh in rajasthan in hindi गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है…

3 days ago

Weston Standard Cell in hindi वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन

वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन Weston Standard Cell in…

3 months ago

polity notes pdf in hindi for upsc prelims and mains exam , SSC , RAS political science hindi medium handwritten

get all types and chapters polity notes pdf in hindi for upsc , SSC ,…

3 months ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now