In data structures, what does unshift do?
ڈیٹا سٹرکچرز میں، ان شفٹ کیا کرتا ہے؟
- Adds an element to the beginning
- Removes the last element
- Removes the first element
- Adds an element to the end
Explanation
- In arrays or lists, unshift adds a new element to the start of the structure.
- The existing elements are shifted one position to the right to make space.
- The opposite operation is shift, which removes the first element.
- Unshift is useful when you need to prioritize new elements at the front.
- It is commonly used in queue implementations and array manipulations.
Related MCQs
ریم سے کیا مراد ہے؟
- Random Access Memory
- Random Access Money
- Random Accurate Memory
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
اگر آپ قریب کی دو عمارتوں کو جوڑنا چاہتے ہیں تو آپ مندرجہ ذیل میں سے کون سا نیٹ ورک استعمال کریں گے؟
- Metropolitan Area Network (MAN)
- Local Area Network (LAN)
- Wide Area Network (WAN)
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ڈیجیٹل سگنلز کو اینالاگ سگنلز میں تبدیل کرنے والی ڈیوائس کا کیا نام ہے؟
- Router
- Switch
- Modem
- None of above
اس سوال کو وضاحت کے ساتھ پڑھیں
ای میل ایڈریس دو حصوں پر مشتمل ہوتا ہے، صارف نام یا آئی ڈی اور _____؟
- URL
- Domain name
- Password
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ڈی او ایس کا مطلب کیا ہے؟
- Digital operating system
- Disk operation system
- Disk operating system
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Leave a Reply
Your email address will not be published. Required fields are marked *