March 10th, 2011, 11:53 AM
Data Structure VS Database
Why do we need to learn data structure? Why don't we just use database and sql command?
I am not quite sure but I think a database has flatten files. When running a database server, it creates an object which can serve operations (e.g. find, insert, remove, sort).
Q1: Is that object like a data collection that has some kinds of data structure inside? or Is that object like a stream?
I can code a program to read data from a text file and create an object to keep the data in any kinds of data structure (e.g. binary tree, hash map). In other word, to load data from disk to memory with a data structure. But loading tends to be slow. A sql database seems to be a better idea.
Initializing is faster, and all operations is fast too. Only one thing I can think why I need to use data structure is only when I manage with small data. It may not worth to create a database. But if i operate only small data, why do I need binary tree, hash map, etc. I just use an array.
Q2: In what kinds of application do we need data structure source code instead of a database?
The question may sound trivial for someone.
But I really doubt it. Please help!!
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!