Thread: Data structure BASIC

  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    50

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

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2019
    Posts
    214
    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).

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. difference between data object and data structure?
    By c_lady in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2011, 12:30 PM
  2. Basic doubt in C structure
    By cbalu in forum Linux Programming
    Replies: 2
    Last Post: 08-17-2009, 11:03 AM
  3. Data structure for storing serial port data in firmware
    By james457 in forum C Programming
    Replies: 4
    Last Post: 06-15-2009, 09:28 AM
  4. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  5. Basic help with the class structure
    By hobscrk777 in forum C++ Programming
    Replies: 4
    Last Post: 06-08-2006, 04:31 PM

Tags for this Thread