World's most popular travel blog for travel bloggers.

[Solved]: Why do we use multiple data structures?

, , No Comments
Problem Detail: 

I'm studying elementary data structures like Linked List, Doubly Linked List and Binary Trees like Binary Search Trees.

Both runs in worst case O(n) in the same operations, so why don't we use only one data structure?

Asked By : Simone C.

Answered By : adrianN

Aspects other than asymptotic worst case time are also important. For example

  • Actual speed in practice
  • Memory consumption
  • Implementation difficulty

Algorithmic analysis almost never tells you the complete story and never should be used to justify blanket statements like "this data structure is the best if you need operations x,y,z".

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/59684

3.2K people like this

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback