+ 5
Is there any data structure that has the random access feature of an array and the element insertion efficiency of a linked list
Maybe not because I can't find such type of data structure when I do a search.
7 ответов
+ 4
To be able to access the element at position i without going through previous elements and to be able to insert an element at position j without shifting subsequent elements. Why? Perhaps for computational efficiency and have a high speed of operation.
+ 4
Dynamic arrays. vector in C, List in C#, ArrayList in Java
+ 4
No I don't think so. Every data structure has its own complexity to an algorithm and features which make the algo simpler. As arrays are best for accessing and linked lists for insertion and deletion. Please let me know if there is some data type you're looking for.👍
+ 2
But why would you want such a data structure?
+ 2
Did you ever thought about SQL ? This is on my opinion the best option Sonic.
+ 2
I would say hashtable could match what your are looking for. It is quite efficient for accessing and inserting data.
- 1
Try Ruby!😃