Which of the following operations is typically more efficient in a linked list compared to an array?

Which of the following operations is typically more efficient in a linked list compared to an array?

مندرجہ ذیل میں سے کون سا آپریشن عام طور پر ایک صف کے مقابلے میں منسلک فہرست میں زیادہ موثر ہے؟
Explanation
  • In a linked list, inserting or deleting an element at the beginning is more efficient (O(1)) because there is no need to shift other elements, unlike in an array.
  • Arrays require shifting elements to insert or delete at the beginning, which takes O(n) time.
  • This making it less efficient compared to a linked list.