
David W. answered 12/03/15
Tutor
4.7
(90)
Experienced Prof
You may quote me (one of the courses I taught at a University was Data Structures) --
"For every algorithm to effectively solve a problem, there are associated 'best practices' data structures."
My very simple example (that any Middle School student could understand) was the representation of a Tic-Tac-Toe game:
-- it could be a "set" with solution "subsets"
-- it could be "bit patterns" for 'X' and for 'O' and for 'game' and for 'available' (note: AND, OR, XOR are quick!)
-- it could be logic to check patters of (row, column) in arrays in order to make a move or to check for a 'win'
-- it could be a linked-list of moves, game, and available
(note: Think about the maximum size of an Excel spreadsheet; it MUST be stored as a sparse array!)
-- (almost any data structure could be used to play Tic-Tac-Toe)
Some algorithms allocate/de-allocate memory as needed (like reusing disk space from deleted files); this takes processor time and is often restricted in real-time applications.
Some computers (especially embedded ones in games or special devices) have a limited amount of memory and a slow, inexpensive processor (although cost and speed have improved very rapidly!); why should anyone be allowed to change the data structure of a digital watch? (Note: You are only allowed to set the time, turn on/off beep, change from 12/24-hour operation, etc., not the data structure used to store this information).
I once changed a simple program (that used a bubble sort algorithm) on a small minicomputer so that it would sort a large disk file rather than a small array in memory. The swapping of values in cells was pretty quick for 100 values, but for 10,000, I was still waiting after half-an-hour.
Today, most 'data structures' are, in fact. data bases. There are many, many inter-related relational tables of information that are carefully designed to control duplication of information, to maximize speed and minimize cost, to maintain integrity of information (think about airline tickets or hospital patient information or IRS tax information, for example), and to restrict access to information (again, airline tickets or hospital patient information or IRS tax information should not be given to, nor changed by, 'just anyone.').
There are hundreds of great books in the computer science field that deal with this topic (if you understand the role that data structures play in computing algorithms); my answer is very terse.
Now, why should only 'advanced users' be allowed to make a change to a data structure?
Suppose anyone could change the way your computer disk stored files -- with a file name, links to groups of data on tracks, and indicators of in-use/not-in use, etc. These data structures are tightly associated with their algorithms -- (for example, read about NTFS on Wikipedia). If anyone other than an authorized, qualified, expert team changed these (for example, they did. when encryption was added as an option), many millions of computers would be affected (note: this is what hackers do when they produce a virus).