Amiga.org

Amiga computer related discussion => Amiga/MorphOS/AROS Programmers Forum => Topic started by: trekiej on February 21, 2018, 09:45:28 PM

Title: Data Structures Question
Post by: trekiej on February 21, 2018, 09:45:28 PM
I would like to get into Data Structures what can I do?
What books, web sites, etc. would recommend?
Title: Re: Data Structures Question
Post by: bloodline on February 22, 2018, 07:14:29 AM
A data structure is a relatively simple concept, it's basically just a collection of variables, do you have an application in mind?
Title: Data Structures Question
Post by: SamuraiCrow on February 22, 2018, 10:26:12 AM
Wikipedia should suffice for something as technical as this.
Title: Re: Data Structures Question
Post by: remotenemesis on February 22, 2018, 02:44:52 PM
Lots of very helpful videos on Youtube too.

Data structures and algorithms are very closely coupled. Learning about Linked Lists (singly and doubly linked), Stacks and Trees is a good start.
Title: Re: Data Structures Question
Post by: Pat the Cat on February 22, 2018, 03:43:56 PM
All good answers... partly it depends on whether you are trying to analyze an existing data structure (which can be fiendishly difficult if you are trying to disassemble hex code) or start on designing and understanding your own data structures.

The basic, basic idea - if you design your data structures correctly (most C code has lots of DEFine statements or similar at the beginning) then the actual code becomes more straightforward to write.

Object Oriented Programming takes this the concept a little further, in that it usually has tools to adjust and edit "objects" (the data structure) so existing code doesn't need to be modified much if at all... very handy if you've got code you know is good, but the data structure / object format needs modification to make it compatible with some other application.

If you have the (rather old, mid 90s) developer pack, it has examples of typical Amiga structures like IFF (interchange file format) which is probably what most Amiga coders study first. Because, it's used by so many different Amiga applications!

This link is UNTESTED but looks OK from my end, for an ISO of that developer pack... I am confident it will have some examples (in C source code) of typical Amiga data structures.

https://archive.org/details/amiga-developer-cd-v1_1
Title: Re: Data Structures Question
Post by: trekiej on February 22, 2018, 08:40:22 PM
Thanks everyone, I am thinking of Data Structures as taught at University.
I bought this recently and hope to use it with other languages.
Fundamentals of Data Structures in Pascal book.
If I understand correctly Data Structures is taught second after introducing a Programming Language.

Unfortunately, I did not get to Data Structures much in school. In High School it Bubble Sort and Binary Search. In College it was Bucket Sort.

I have seen a book for C64 called 64 Data Files and am interested in what it says. It would be nice to make my own file types.
Title: Re: Data Structures Question
Post by: nicholas on February 23, 2018, 09:08:07 AM
Quote from: trekiej;836464
Thanks everyone, I am thinking of Data Structures as taught at University.
I bought this recently and hope to use it with other languages.
Fundamentals of Data Structures in Pascal book.
If I understand correctly Data Structures is taught second after introducing a Programming Language.

Unfortunately, I did not get to Data Structures much in school. In High School it Bubble Sort and Binary Search. In College it was Bucket Sort.

I have seen a book for C64 called 64 Data Files and am interested in what it says. It would be nice to make my own file types.


This is the standard uni text book. Not cheap but you can find it on libgen.PW

Data Structures and Algorithm Analysis in C++, International Edition by Mark Weiss
https://www.amazon.co.uk/dp/0273769383/ref=cm_sw_r_cp_apa_jA9JAbDDD6C30
Title: Re: Data Structures Question
Post by: olsen on February 23, 2018, 01:11:45 PM
Quote from: trekiej;836464
Thanks everyone, I am thinking of Data Structures as taught at University.
I bought this recently and hope to use it with other languages.
Fundamentals of Data Structures in Pascal book.
If I understand correctly Data Structures is taught second after introducing a Programming Language.

Unfortunately, I did not get to Data Structures much in school. In High School it Bubble Sort and Binary Search. In College it was Bucket Sort.


That Pascal book might be a bit short and somewhat long in the tooth.

When I was taking my first steps in programming in Pascal (on an Apple II at school, running the ubiquitous UCSD Pascal system) I learned from photocopied pages which I much later discovered came from Niklaus Wirth's book "Algorithms + data structures = programs". What a book!

Mr. Wirth updated that book again and again, as time progressed and as he created new languages on the foundations he had built. That book is available for download in PDF format from http://www.ethoberon.ethz.ch/WirthPubl/AD.pdf.

It's as good an introduction to the matter as you might find, and beyond that even ventures into the deeper end of the pool: how to make a program which can build programs from source code?

Quote
I have seen a book for C64 called 64 Data Files and am interested in what it says. It would be nice to make my own file types.


This could be a very C64-specific book. The 1541 floppy disk drive would support sequential and random access files, and the random access required a whole bag of tricks to make it work. So, be careful, you might just end up spending money on learning something that was useful more than 30 years ago, and has not been that useful since...
Title: Re: Data Structures Question
Post by: trekiej on February 23, 2018, 07:22:15 PM
Wow, I will continue to look at this.
I will start of with Pascal making variables and reading up on its data types.
I am hoping to add Cobol to the list of languages to study.
Title: Data Structures Question
Post by: SamuraiCrow on February 23, 2018, 08:35:38 PM
Quote from: trekiej;836505
Wow, I will continue to look at this.
I will start of with Pascal making variables and reading up on its data types.
I am hoping to add Cobol to the list of languages to study.


I would skip those two languages and download FreePascal (an Object Pascal compiler) or use the PDF link that Olsen posted with OberonA from the Aminet.  Both are successors to Pascal with the former being backward compatible and the latter offering a managed code sandbox as a debug mode.  Given the choice, I would try Oberon myself before moving on to OOP just for the sandbox.
Title: Re: Data Structures Question
Post by: trekiej on February 24, 2018, 07:04:34 PM
I downloaded fpc.lha for AOS4 and now am looking up Oberon.
Title: Data Structures Question
Post by: SamuraiCrow on February 25, 2018, 02:01:37 AM
Oberon may not be available as an OS4 native package.  The one I indicated was for 68k.
Title: Re: Data Structures Question
Post by: trekiej on February 25, 2018, 05:44:52 PM
Thanks, I did download Oberon-A from Aminet. It is Oberon 2, I believe.
To answer Blood line's question, I am thinking of working with videos and pictures.
I would like to correct them.