What is the fastest and most memory-efficient data structure?
What is the fastest and most memory-efficient data structure?
To put simply, I need to know what data structure will be the most memory-efficient, but still optimize speed as much as possible. Any information helps.
Re: What is the fastest and most memory-efficient data structure?
This is extremely dependent upon what the needs are, based upon requirements such as data storage, data retrieval, and data traversing.
Re: What is the fastest and most memory-efficient data structure?
I'll get back to you on that when I have more information.
For now, is anyone able to outline a few of the better data structures and their advantages/disadvantages. It would be very appreciated.
Re: What is the fastest and most memory-efficient data structure?
Technically, everything stored on your computer is in an array.
There is no one "most efficient" data structure. Every data structure has it's pluses and minuses. Some data structures are designed to take up less room while others are designed to give you more speed. Even within a category of data structures (such as heaps or trees) you will have multiple data structures which each are used for their own purposes.
For a list of some commonly used data structures, see List of data structures - Wikipedia, the free encyclopedia
Re: What is the fastest and most memory-efficient data structure?
Quote:
Originally Posted by
helloworld922
Technically, everything stored on your computer is in an array.
There is no one "most efficient" data structure. Every data structure has it's pluses and minuses. Some data structures are designed to take up less room while others are designed to give you more speed. Even within a category of data structures (such as heaps or trees) you will have multiple data structures which each are used for their own purposes.
For a list of some commonly used data structures, see
List of data structures - Wikipedia, the free encyclopedia
Thank you. I'll use that as a reference when trying to figure out how to speed the program we have.
Re: What is the fastest and most memory-efficient data structure?
Quote:
Originally Posted by
helloworld922
Technically, everything stored on your computer is in an array.
There is no one "most efficient" data structure. Every data structure has it's pluses and minuses. Some data structures are designed to take up less room while others are designed to give you more speed. Even within a category of data structures (such as heaps or trees) you will have multiple data structures which each are used for their own purposes.
For a list of some commonly used data structures, see
List of data structures - Wikipedia, the free encyclopedia
This is simply not true. I don't know why you'd say everything is stored in an array, when that's one of the primary reasons trees and nodes are around. Unless you're talking about at a physical hardware level, in which case it's still not true.
For the original question. I won't pretend I know everything, but when you say what data structure is the most memory efficient, if you're talking about storage space in either your primary or secondary memories then an int is an int, it takes up a particular amount of space no matter how you organise is. Arrays reserve a particular amount of space depending on how much space you allocate it.
With hard drives and ram getting as large as they are, it's rarely an issue about space or memory, but rather efficiency and speed.
In which case, trees using nodes are the most efficient I've come across so far. As long as the tree is balanced... Which is up to the programmer to do.