Which of the basic data structures is the most suitable if you want to be able to insert elements in the middle in o(1)o(1)o(1)?
Answers
Answer:
Linked List
Explanation:
As you can insert in between nodes without shuffling elements, your new node say B will point to the next node say C and the previous node say A which was earlier pointing to C will now point to A.
A -> C
Insert Node B between A and C
A -> B -> C
LinkedList
Explanation:
Linked lists are regularly used due to their green insertion and deletion.
They may be used to enforce stacks, queues, and different summary facts types.
A connected listing is a chain of facts structures, that are linked collectively thru hyperlinks.
A Linked List is a chain of hyperlinks that incorporates items. Link − Each hyperlink of a connected listing can keep facts known as an element.
Next − Each hyperlink of a connected listing consists of a hyperlink to the following hyperlink known as Next.