In pointer implementation of linked lists, which operation can be performed in constantलिंक की गई सूचियों के सूचक कार्यान्वयन में, नोड्स डालते या हटाते समय निरंतर समय (ओ (1)) में
In pointer implementation of linked lists, which operation can be performed in constant
time (O(1)) when inserting or deleting nodes?
लिंक की गई सूचियों के सूचक कार्यान्वयन में, नोड्स डालते या हटाते समय निरंतर समय (ओ (1)) में
कौन सा ऑपरेशन किया जा सकता है?
Show answerHide answer
Correct answer: (A) Inserting at the beginningशुरुआत में सम्मिलित करना
Explanation
Inserting at the beginning of a linked list only needs a new node pointing to the old head and an updated head pointer, so it takes O(1) time. The others need traversal.लिंक्ड लिस्ट के आरंभ में डालने के लिए केवल पुराने head की ओर इशारा करता नया नोड और अद्यतन head पॉइंटर चाहिए, इसलिए O(1) समय लगता है। अन्य में traversal चाहिए।