Singly Linked List Insertion: At Beginning, At End, After a Node Notes in Hindi & English : सिंगली लिंक्ड लिस्ट इंसर्शन: शुरुआत, अंत और मध्य में जोड़ना और 20 महत्वपूर्ण MCQ प्रश्न (Rajasthan IT Exam)

Post a Comment

PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम Singly Linked List Insertion: At Beginning, At End, After a Node (सिंगली लिंक्ड लिस्ट इंसर्शन: शुरुआत, अंत और मध्य में जोड़ना) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।

Overview: Inserting a node into a Singly Linked List allocates heap storage and updates next pointers in place without shifting existing elements. Prepending at head executes in O(1) time, inserting immediately after a known node pointer takes O(1) time, and appending at the tail runs in O(n) with only a head pointer or O(1) when maintaining an auxiliary tail pointer.

अध्याय सार: सिंगली लिंक्ड लिस्ट में नया नोड जोड़ने (Insertion) के लिए हीप से नया नोड बनाकर केवल next पॉइंटर्स को जोड़ा जाता है, बिना किसी तत्व को खिसकाए। शुरुआत (head) पर और किसी ज्ञात नोड के ठीक बाद जोड़ना हमेशा O(1) समय लेता है, जबकि अंत में जोड़ना केवल head होने पर O(n) और अतिरिक्त tail पॉइंटर होने पर O(1) समय लेता है।

Singly Linked List Insertion: At Beginning, At End, After a Node: Detailed Notes & Architecture (सिंगली लिंक्ड लिस्ट इंसर्शन: शुरुआत, अंत और मध्य में जोड़ना)

1. Insertion at Beginning (Prepend): O(1) Mechanics & Double Pointer (शुरुआत में इंसर्शन (At Beginning): O(1) प्रक्रिया व डबल पॉइंटर)

[EN] Prepending a new node requires allocating memory, storing data, setting newNode->next = *head, and finally updating *head = newNode. This works cleanly in O(1) constant time even when the list is initially empty (*head == NULL, since newNode->next becomes NULL automatically). Because the caller's head pointer address itself changes, C functions must accept a pointer-to-pointer (struct Node **head) or return the updated head pointer.

[HI] शुरुआत में जोड़ने हेतु नया नोड बनाकर पहले newNode->next = *head और फिर *head = newNode किया जाता है। यदि लिस्ट खाली भी हो (*head == NULL) तब भी यह O(1) में सही काम करता है। चूँकि C में कॉल-बाय-वैल्यू होता है, इसलिए कॉलर के head को बदलने हेतु फंक्शन में डबल पॉइंटर (struct Node **head) पास करना या नया head लौटाना आवश्यक होता है।

2. Insertion at End (Append): Head-Only O(n) vs Tail-Pointer O(1) (अंत में इंसर्शन (At End): केवल Head होने पर O(n) बनाम Tail पॉइंटर से O(1))

[EN] To append a new node (whose next is initialized to NULL), first handle the empty-list edge case: if *head == NULL, simply assign *head = newNode (otherwise traversing temp->next crashes!). When non-empty and maintaining only head, walk temp from *head until temp->next == NULL and set temp->next = newNode in O(n) time. Maintaining an explicit tail pointer reduces appending to O(1) via tail->next = newNode; tail = newNode; (updating both head and tail when empty).

[HI] अंत में नया नोड (newNode->next = NULL) जोड़ते समय पहले खाली लिस्ट की जाँच करें: यदि *head == NULL हो तो सीधे *head = newNode करें (अन्यथा temp->next क्रैश करेगा)। केवल head होने पर अंतिम नोड (temp->next == NULL) तक चलकर O(n) में जोड़ते हैं, जबकि अलग tail पॉइंटर रखने पर tail->next = newNode; tail = newNode से यह कार्य O(1) में हो जाता है।

3. Insertion After a Given Node or at Specific Position k (किसी नोड के बाद या विशिष्ट स्थिति k पर इंसर्शन)

[EN] When given a direct pointer prevNode (guaranteed non-NULL), inserting after it executes in O(1) time without searching: first save the remaining chain via newNode->next = prevNode->next, and THEN link prevNode->next = newNode. To insert at 1-based position k (k >= 2), advance a temporary pointer (k - 2) steps from head to locate node (k - 1), checking curr != NULL at each hop to guard against out-of-range positions before performing the same two-pointer splice in O(k) worst-case O(n) time.

[HI] यदि किसी पूर्व नोड का पॉइंटर prevNode पहले से दिया गया हो, तो पहले newNode->next = prevNode->next और फिर prevNode->next = newNode करके O(1) में नया नोड जुड़ जाता है। किसी 1-आधारित स्थान k (k >= 2) पर जोड़ने के लिए head से (k - 2) कदम आगे बढ़कर (k - 1)-वें नोड को खोजा जाता है, जिसमें अधिकतम O(n) समय लगता है।

4. Pointer Assignment Order Bugs & O(1) Insert-Before Trick (पॉइंटर क्रम की घातक गलतियाँ और पहले जोड़ने की O(1) ट्रिक)

[EN] Reversing the two assignment lines—writing prev->next = newNode; before newNode->next = prev->next;—immediately overwrites prev->next with newNode, causing newNode->next = newNode (an infinite self-loop) and leaking the remainder of the list! Similarly, never forget malloc NULL checks before accessing newNode->data. Interestingly, inserting BEFORE a given target pointer (without knowing its predecessor) takes O(n) via traversal, OR O(1) by inserting after target and swapping their data values.

[HI] यदि आप क्रम उलटकर पहले prev->next = newNode और फिर newNode->next = prev->next लिख दें, तो newNode स्वयं की ओर इशारा करने लगेगा (Self-loop) और आगे की पूरी लिस्ट खो जाएगी! हमेशा पहले दाहिने हिस्से को जोड़ें। रोचक बात यह है कि किसी दिए गए नोड के ठीक *पहले* जोड़ने के लिए उसके बाद नोड जोड़कर दोनों का डेटा स्वैप करने से यह काम O(1) में भी हो सकता है।

Syntax, Formula & Technical Example (Singly Linked List Insertion: At Beginning, At End, After a Node)

void insertBegin(struct Node **head, int val) {
    struct Node *nn = (struct Node *)malloc(sizeof(struct Node));
    if (!nn) return;                          // Heap allocation check
    nn->data = val;
    nn->next = *head;                         // Step 1: point to old head
    *head = nn;                               // Step 2: update head
}
void insertAfter(struct Node *prev, int val) {
    if (!prev) return;
    struct Node *nn = (struct Node *)malloc(sizeof(struct Node));
    if (!nn) return;
    nn->data = val; nn->next = prev->next;    // Preserve tail chain FIRST
    prev->next = nn;
}

Singly Linked List Insertion: At Beginning, At End, After a Node Quick Reference & Comparison Table

Insertion OperationTime ComplexityCritical Pointer Sequence
Insert at BeginningO(1) with head only or with tailSet newNode->next = head before updating head = newNode
Insert at EndO(n) with head only; O(1) with tailHandle head == NULL separately; tail->next = newNode
Insert After Known NodeO(1) given prev node pointerLink newNode->next = prev->next before prev->next = newNode
Insert at Position kO(k) average; O(n) worst caseWalk k-2 steps to node k-1 checking NULL bounds

Singly Linked List Insertion: At Beginning, At End, After a Node Top 20 Bilingual MCQs with Answers

Q1. What is the worst-case time complexity to insert a new node at the BEGINNING of a Singly Linked List of n nodes?

(n नोड्स वाली सिंगली लिंक्ड लिस्ट की शुरुआत (Beginning) में नया नोड जोड़ने की वर्स्ट-केस टाइम कॉम्प्लेक्सिटी क्या है?)

(A) O(n)

(B) O(1)

(C) O(log n)

(D) O(n^2)

Correct Answer: (B)

[EN] Prepending only updates two pointers (newNode->next and head) regardless of list length n.

[HI] शुरुआत में जोड़ने पर लिस्ट की लंबाई चाहे कितनी भी हो, केवल 2 पॉइंटर्स बदलने से काम O(1) में हो जाता है।

Q2. What is the time complexity of inserting at the END of a Singly Linked List when ONLY the head pointer is maintained vs when BOTH head and tail pointers are maintained?

(केवल head पॉइंटर होने पर बनाम head और tail दोनों पॉइंटर होने पर SLL के अंत में नोड जोड़ने की टाइम कॉम्प्लेक्सिटी क्रमशः क्या होती है?)

(A) O(1) with head only; O(n) with head and tail

(B) O(1) in both cases

(C) O(n) with head only; O(1) with head and tail

(D) O(n) in both cases

Correct Answer: (C)

[EN] With only head, you must traverse all n nodes to find the last node (O(n)); a maintained tail pointer allows instant O(1) linking.

[HI] केवल head होने पर अंतिम नोड तक पहुँचने में O(n) समय लगता है, जबकि tail पॉइंटर होने पर यह सीधे O(1) में हो जाता है।

Q3. What bug occurs in insertAfter(prev, val) if someone writes: prev->next = newNode; newNode->next = prev->next;?

(insertAfter(prev, val) में यदि गलती से पहले prev->next = newNode; और बाद में newNode->next = prev->next; लिख दिया जाए, तो क्या होगा?)

(A) The list becomes doubly linked cleanly

(B) newNode->next points to newNode itself (self-loop), losing the rest of the list

(C) newNode is inserted safely before prev instead of after

(D) It inserts newNode at the head of the list

Correct Answer: (B)

[EN] Because prev->next was already overwritten with newNode, setting newNode->next = prev->next creates a 1-node cycle on newNode.

[HI] prev->next पहले ही newNode बन चुका है, इसलिए newNode->next = prev->next करने से newNode स्वयं से जुड़कर अनंत लूप बना देगा और बाकी लिस्ट खो जाएगी।

Q4. What bug occurs in insertBegin if you execute *head = newNode; before newNode->next = *head;?

(insertBegin में यदि newNode->next = *head; से पहले ही *head = newNode; लिख दिया जाए तो क्या परिणाम होगा?)

(A) Both nodes swap positions cleanly

(B) The compiler automatically reorders the two pointer assignments

(C) The new node is appended to the tail instead

(D) newNode points to itself and the entire preexisting list becomes unreachable (memory leak)

Correct Answer: (D)

[EN] Overwriting *head first erases the address of the old first node before newNode->next can capture it.

[HI] पहले *head बदलने से पुरानी लिस्ट का पता खो जाएगा और newNode स्वयं को ही पॉइंट करने लगेगा।

Q5. Why does a C function void pushFront(struct Node **headRef, int x) accept a double pointer (struct Node **)?

(C में शुरुआत में नोड जोड़ने वाले फंक्शन में सिंगल के बजाय डबल पॉइंटर (struct Node **headRef) क्यों पास किया जाता है?)

(A) Because single pointers cannot point to malloc memory

(B) Because each node actually contains two next pointers

(C) Because double pointers automatically sort the list

(D) Because C passes arguments by value; modifying the caller's head pointer itself requires passing head's address

Correct Answer: (D)

[EN] Passing struct Node *head passes a local copy; changing head = newNode inside the function would not update the caller's head.

[HI] C में कॉल-बाय-वैल्यू होने के कारण सिंगल पॉइंटर की केवल कॉपी जाती है; कॉलर का मूल head बदलने हेतु उसका पता (डबल पॉइंटर) देना आवश्यक है।

Q6. When appending to a Singly Linked List, what happens if you forget to check if (*head == NULL) before running while (temp->next != NULL)?

(अंत में इंसर्शन करते समय यदि *head == NULL की जाँच किए बिना सीधे while (temp->next != NULL) चला दिया जाए, तो क्या होगा?)

(A) Dereferencing NULL->next crashes the program with a segmentation fault on an empty list

(B) It cleanly inserts the first node at index 0

(C) The loop skips zero times and inserts cleanly

(D) temp automatically creates a dummy node

Correct Answer: (A)

[EN] When the list is empty, temp equals NULL, so evaluating temp->next triggers immediate invalid memory dereference.

[HI] खाली लिस्ट होने पर temp का मान NULL होगा और temp->next पढ़ते ही प्रोग्राम Segmentation Fault से क्रैश हो जाएगा।

Q7. What happens if you insert values 10, 20, and 30 sequentially using insertBegin() on an initially empty Singly Linked List?

(एक खाली सिंगली लिंक्ड लिस्ट में क्रमशः 10, 20 और 30 को insertBegin() द्वारा जोड़ने पर अंतिम लिस्ट कैसी दिखेगी?)

(A) 30 -> 10 -> 20 -> NULL

(B) 10 -> 20 -> 30 -> NULL

(C) 30 -> 20 -> 10 -> NULL

(D) 10 -> 30 -> 20 -> NULL

Correct Answer: (C)

[EN] Each new item becomes the new head, reversing insertion order (LIFO behavior, just like a Stack push).

[HI] हर नया तत्व नया head बन जाता है (LIFO क्रम), इसलिए अंतिम लिस्ट 30 -> 20 -> 10 -> NULL होगी।

Q8. Given a pointer prev pointing directly to the 4th node in a 10-node Singly Linked List, what is the time complexity to insert a new node right AFTER prev?

(10 नोड्स वाली SLL में 4थे नोड का पॉइंटर prev सीधे ज्ञात होने पर उसके ठीक बाद नया नोड जोड़ने में कितना समय लगेगा?)

(A) O(n)

(B) O(1)

(C) O(log n)

(D) O(4) scaling with n

Correct Answer: (B)

[EN] Since the location prev is already in hand, updating newNode->next = prev->next and prev->next = newNode takes O(1).

[HI] जब पूर्व नोड का पॉइंटर prev पहले से उपलब्ध हो, तो बिना ट्रैवर्सल के केवल 2 पॉइंटर बदलकर O(1) में इंसर्शन होता है।

Q9. How many pointer fields/variables are modified to insert a new node in the middle after a non-tail node prev?

(लिस्ट के मध्य में किसी ज्ञात नोड prev के बाद नया नोड जोड़ने में न्यूनतम कितने पॉइंटर्स (Links) बदले या सेट किए जाते हैं?)

(A) 2 pointers (newNode->next and prev->next)

(B) 0 pointers

(C) 1 pointer (only prev->next)

(D) 4 pointers (head, tail, prev->next, newNode->next)

Correct Answer: (A)

[EN] Only newNode->next (set to prev->next) and prev->next (set to newNode) are written; head and subsequent nodes stay untouched.

[HI] केवल 2 पॉइंटर्स (newNode->next और prev->next) को अपडेट करना होता है।

Q10. To insert a node at 1-based position pos = 5 (where pos=1 is head), how many next hops from head are needed to reach the predecessor node?

(1-आधारित स्थिति pos = 5 (जहाँ pos = 1 पहला नोड है) पर नया नोड जोड़ने के लिए head से कितने कदम आगे जाकर पूर्ववर्ती नोड मिलेगा?)

(A) 4 hops (reaching the 5th node)

(B) 3 hops (reaching the 4th node)

(C) 5 hops (reaching the 6th node)

(D) 1 hop (reaching the 2nd node)

Correct Answer: (B)

[EN] Node 1 is 0 hops, node 2 is 1 hop, node 3 is 2 hops, and node 4 (predecessor of pos 5) is pos - 2 = 3 hops away.

[HI] पहला नोड 0 कदम पर है, इसलिए pos = 5 से ठीक पहले के 4थे नोड तक पहुँचने हेतु pos - 2 = 3 कदम चलना होगा।

Q11. When maintaining both head and tail pointers, what special case MUST execute when inserting the very first node into an empty list?

(यदि SLL में head और tail दोनों पॉइंटर रखे गए हैं, तो खाली लिस्ट में पहला नोड जोड़ते समय क्या विशेष ध्यान रखना आवश्यक है?)

(A) Both head AND tail must be set to point to the new node

(B) tail must point to head->next (NULL)

(C) Only head is updated while tail remains NULL

(D) Only tail is updated while head remains NULL

Correct Answer: (A)

[EN] For a 1-node list, that single node is simultaneously both the first node (head) and the last node (tail).

[HI] 1 नोड की लिस्ट में वही एक नोड head और tail दोनों होता है, इसलिए दोनों को नए नोड पर सेट करना अनिवार्य है।

Q12. What is the time complexity of inserting a new key into a SORTED Singly Linked List while preserving sorted order?

(एक पहले से सॉर्टेड सिंगली लिंक्ड लिस्ट में नया मान उसके सही क्रम में जोड़ने की टाइम कॉम्प्लेक्सिटी क्या होती है?)

(A) O(n)

(B) O(log n)

(C) O(n log n)

(D) O(1)

Correct Answer: (A)

[EN] Finding the sorted insertion point requires linear traversal from head in O(n) worst-case time (binary search cannot index SLL in O(1)).

[HI] सही क्रम वाला स्थान खोजने के लिए head से क्रमिक ट्रैवर्सल करना पड़ता है, जिससे अधिकतम O(n) समय लगता है।

Q13. How can you insert a new value x immediately BEFORE a given non-NULL node pointer target in O(1) time without knowing target's predecessor?

(बिना पिछले नोड का पॉइंटर जाने, किसी दिए गए नोड target के ठीक पहले नया मान x केवल O(1) समय में कैसे जोड़ा जा सकता है?)

(A) Insert a new node AFTER target holding target->data, then overwrite target->data = x

(B) Walk backwards using target->prev pointer

(C) It is strictly impossible in O(1) under any method

(D) Reverse the entire list twice

Correct Answer: (A)

[EN] Allocating newNode after target, copying target->data into newNode->data, and placing x into target->data achieves logical insert-before in O(1).

[HI] target के ठीक बाद नया नोड जोड़कर उसमें target->data कॉपी करें और target->data में नया मान x रख दें—यह काम O(1) में हो जाता है।

Q14. Why should a C program check if (newNode == NULL) right after malloc() inside an insertion routine?

(इंसर्शन फंक्शन में malloc() के तुरंत बाद if (newNode == NULL) की जाँच करना क्यों आवश्यक है?)

(A) Because malloc returns NULL whenever the list already has > 1 node

(B) To free the old head pointer automatically

(C) Because newNode->next defaults to NULL only after an if check

(D) To handle out-of-memory failure gracefully instead of crashing when assigning newNode->data

Correct Answer: (D)

[EN] If heap memory is exhausted, malloc returns NULL and writing newNode->data = val immediately causes a segmentation fault.

[HI] यदि हीप मेमोरी भर जाए तो malloc NULL लौटाता है; जाँच के बिना newNode->data लिखने पर तुरंत क्रैश हो जाएगा।

Q15. Which operation gives Singly Linked List a decisive asymptotic speed advantage over a standard Contiguous Array?

(किस ऑपरेशन में सिंगली लिंक्ड लिस्ट एक सामान्य एरे की तुलना में निर्णायक रूप से तेज होती है?)

(A) Summing all elements sequentially with minimal cache misses

(B) Inserting at the beginning of a sequence of n elements (O(1) vs O(n))

(C) Deleting the last element when only head is tracked

(D) Accessing the middle element at index n/2 (O(1) vs O(n))

Correct Answer: (B)

[EN] Front insertion in an SLL takes O(1) pointer rewiring, whereas an array must shift all n elements right in O(n).

[HI] शुरुआत में तत्व जोड़ने पर SLL केवल O(1) लेती है जबकि एरे में सभी n तत्वों को O(n) में खिसकाना पड़ता है।

Q16. Which statement is NOT true regarding Singly Linked List insertion?

(सिंगली लिंक्ड लिस्ट में इंसर्शन के बारे में इनमें से कौन सा कथन असत्य (NOT true) है?)

(A) Inserting at the beginning executes in O(1) time

(B) Updating head inside a C void function requires Node **head

(C) Appending at the end of an SLL always takes O(1) time even when only a head pointer is stored

(D) Inserting after a known node pointer takes O(1) time

Correct Answer: (C)

[EN] With only a head pointer (and no tail pointer), appending at the end must traverse n nodes to reach the tail in O(n) time.

[HI] यदि केवल head पॉइंटर हो (tail पॉइंटर न हो), तो अंत में जोड़ने में O(n) समय लगता है, O(1) नहीं।

Q17. Within Singly Linked List Insertion: At Beginning, At End, After a Node, which insertion operation directly maps to: "O(1) with head only or with tail"?

(Singly Linked List Insertion: At Beginning, At End, After a Node में कौन सा Insertion Operation सीधे "O(1) with head only or with tail" से संबंधित है?)

(A) Insert at End

(B) Insert After Known Node

(C) Insert at Beginning

(D) Insert at Position k

Correct Answer: (C)

[EN] In Singly Linked List Insertion: At Beginning, At End, After a Node, 'Insert at Beginning' handles 'O(1) with head only or with tail' (Set newNode->next = head before updating head = newNode).

[HI] Singly Linked List Insertion: At Beginning, At End, After a Node में 'Insert at Beginning' का कार्य/विवरण 'O(1) with head only or with tail' (Set newNode->next = head before updating head = newNode) है।

Q18. Which option accurately describes 'Insert at End' in Singly Linked List Insertion: At Beginning, At End, After a Node?

(Singly Linked List Insertion: At Beginning, At End, After a Node के संदर्भ में 'Insert at End' की सही विशेषता कौन सी है?)

(A) O(1) given prev node pointer

(B) O(1) with head only or with tail

(C) O(k) average; O(n) worst case

(D) O(n) with head only; O(1) with tail

Correct Answer: (D)

[EN] 'Insert at End' provides 'O(n) with head only; O(1) with tail' — key point: Handle head == NULL separately; tail->next = newNode.

[HI] 'Insert at End' का मुख्य विवरण 'O(n) with head only; O(1) with tail' है (Handle head == NULL separately; tail->next = newNode)।

Q19. In Singly Linked List Insertion: At Beginning, At End, After a Node, identify the correct parameter for the specification: "O(1) given prev node pointer".

(Singly Linked List Insertion: At Beginning, At End, After a Node में "O(1) given prev node pointer" विवरण किस विकल्प के लिए सही है?)

(A) Insert at Position k

(B) Insert at End

(C) Insert at Beginning

(D) Insert After Known Node

Correct Answer: (D)

[EN] 'Insert After Known Node' corresponds to 'O(1) given prev node pointer' (Link newNode->next = prev->next before prev->next = newNode).

[HI] 'Insert After Known Node' का संबंध 'O(1) given prev node pointer' (Link newNode->next = prev->next before prev->next = newNode) से है।

Q20. Considering Singly Linked List Insertion: At Beginning, At End, After a Node, what key behavior defines 'Insert at Position k'?

(Singly Linked List Insertion: At Beginning, At End, After a Node में 'Insert at Position k' की मुख्य भूमिका या मान क्या है?)

(A) O(1) with head only or with tail

(B) O(n) with head only; O(1) with tail

(C) O(k) average; O(n) worst case

(D) O(1) given prev node pointer

Correct Answer: (C)

[EN] 'Insert at Position k' represents 'O(k) average; O(n) worst case' (Walk k-2 steps to node k-1 checking NULL bounds).

[HI] 'Insert at Position k' का अर्थ/मान 'O(k) average; O(n) worst case' है (Walk k-2 steps to node k-1 checking NULL bounds)।

Singly Linked List Insertion: At Beginning, At End, After a Node — Exam FAQs

Q1: Why must newNode->next = prev->next always run BEFORE prev->next = newNode?

हमेशा newNode->next = prev->next को prev->next = newNode से पहले क्यों लिखा जाता है?

[EN] prev->next holds the sole address to the rest of the list after prev. If you overwrite prev->next first, you permanently lose the rest of the list and point newNode back to itself.

[HI] prev->next में आगे की पूरी लिस्ट का पता होता है। यदि पहले prev->next बदल दिया जाए, तो आगे की लिस्ट खो जाएगी और नया नोड खुद की ही ओर इशारा करेगा।

Q2: How do you avoid using double pointers (struct Node **) in C when inserting at the beginning?

C में डबल पॉइंटर (struct Node **) से बचने के लिए शुरुआती इंसर्शन कैसे लिखा जा सकता है?

[EN] Either have insertBegin() return the new struct Node *head (called as head = insertBegin(head, val);) or use a permanent dummy/sentinel head node that never changes address.

[HI] या तो फंक्शन से नया head पॉइंटर return कराएं (head = insertBegin(head, val);), या एक स्थायी डमी (Sentinel) हेड नोड का उपयोग करें।

Q3: Does inserting a node into a Singly Linked List move any existing nodes in RAM?

क्या सिंगली लिंक्ड लिस्ट में नया नोड जोड़ने से पुराने नोड्स मेमोरी में खिसकते हैं?

[EN] No. Existing nodes stay at their exact original heap addresses; only one or two next pointer values change.

[HI] नहीं। पुराने सभी नोड्स मेमोरी में अपने मूल पते पर ही रहते हैं, केवल एक या दो next पॉइंटर्स के पते बदले जाते हैं।

Related Posts

  • Loading related posts...

Post a Comment

Search Topic Notes & 20 MCQs (Hindi / English)