-
Data structure BASIC
Hi !
At every book/tutorial I've read on C/C++ programming language it said that I must start learning DATA STRUCTURE in order to be good programmer, I started to learn it but really weird, once we are programming a program, I mean writing C++ Code and I need stack data structure , then I just need the concept that there's stack and how it works, but there in PC there's not STACK .. it's just a concept that there's something that we can get/retrieve data from and with specific rules....so lets call that stack .. but actually PC doesn't understand in STACK/DATA STRUCTURE .. all about concepts to understand what's going on data structure if I needed to use them while coding .. am I right?
so I can conclude that data structure all about concepts to help me in programming .. no more nothing else .. there's no data structure actually in PC itself, I mean physically on its hardware there's no data structures..
-
You might want to read these two technical dictionary entries for abstract data type and data structure. What you have in mind is the former, but when expressed in code we get the latter, which does have some relation to what's actually happening in hardware since the high level code gets translated into machine code that is actually executed by the computer, and the content of the data structure does live in memory etc.
-
If I understand your points, and I'm not certain that I do, I think I can loosely agree.
The hardware has very limited data structure in it's inherent operation. Most modern hardware has a stack, used to control function calls (and returns), and some structures associated with memory control relative to processes and threads. One might also argue that there are some structures involved in specific SIMD instructions, where specific floating point operations are performed.
Beyond that, however, the complex data structures typical of computer science are not directly implemented by the hardware, but by the software (acknowledging the nature of the hardware).
While I know this isn't in your inquiry, and extended example is that of any bitmap format. The format for, say, jpg images is formalized in a specification, and it is structure data. The hardware likely has nothing to recognize this natively, it is implemented in software. There are some specialized image formats that may be "natively" understood by the graphics hardware.
While one might say the study of data structures help in programming, I might style that as it is required for certain types of work. Data structures are often associated with algorithms, as, for example, the binary tree is inseparable from the algorithms which create it (they must go together).
-
The electrons whizzing through the transistor gates know nothing about data structures.
The transistors themselves know nothing either.
The collective billions of them you inaccurately call 'PC' knows nothing either.
int count; // how many
int money; // how much
Within your program, these may mean different things.
But at every level of abstraction beneath your program, it's all the same.
The meaning is in your program and in your head.