Article Preview
Buy Now
COLUMN
Basic Data Structures, Part I
Finding for the most efficient data structure
Issue: 4.4 (March/April 2006)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 13,166
Starting Page Number: 34
Article Number: 4413
Related Link(s): None
Excerpt of article text...
It is a rare computer program that doesn't manage data -- information -- of some kind. A word processor manages text. Games need to remember high scores, player information, game progress, and more. Basically any program that creates files has to manage that data in memory before it is written to disk. Most programs need ways to organize and display this data, to allow the user to edit the data, and to save and retrieve the data. How this data is organized in memory is known as a
data structure ; using the correct data structure for your project can be the difference between success and failure, a project completed on time or lengthy delays caused by frustrating difficult-to-find bugs. The right data structure can also make updating and adding features to your program easier.When I first began programming, I knew nothing about data structures: I simply used whatever was convenient or available in the language. This usually meant that I used
arrays . Years later as I moved from BASIC to Pascal, I discovered records (calledstructures in other languages), pointers, and linked lists. Suddenly, what used to be such a simple decision that it was no decision at all, was complicated, and I had to think about my long-term goals.Thinking long-term is key when planning your data structure. Your program tomorrow won't be the same program it is today. Initially you just want to get it working; later you may want to add features such as data sorting or the storage of additional information. You might also want to speed up program operations and optimize functions.
...End of Excerpt. Please purchase the magazine to read the full article.