Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: What is the fastest and most memory-efficient data structure?

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default 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.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default 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.

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default 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.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default 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

  5. The Following User Says Thank You to helloworld922 For This Useful Post:

    aussiemcgr (November 21st, 2010)

  6. #5
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: What is the fastest and most memory-efficient data structure?

    Quote Originally Posted by helloworld922 View Post
    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.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  7. #6
    Junior Member
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: What is the fastest and most memory-efficient data structure?

    Quote Originally Posted by helloworld922 View Post
    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.

Similar Threads

  1. Replies: 4
    Last Post: September 5th, 2010, 10:29 AM
  2. Memory Handling -de allocate memory in Java
    By 19world in forum Java Theory & Questions
    Replies: 4
    Last Post: June 15th, 2010, 04:05 AM
  3. Data Structure for ordered binay tree
    By wash in forum Algorithms & Recursion
    Replies: 0
    Last Post: April 23rd, 2010, 05:31 PM
  4. .xls data structure
    By helloworld922 in forum JDBC & Databases
    Replies: 3
    Last Post: August 20th, 2009, 07:12 PM
  5. Replies: 1
    Last Post: March 28th, 2009, 07:21 AM