Recent

Author Topic: Data Structures, Containers, Collections  (Read 5705 times)

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Data Structures, Containers, Collections
« on: May 29, 2021, 09:50:19 pm »
ﻷخذ فكرة فقط! ما الفرق بين هذه المفاهيم الثلاثة ولو أمكن بعض الأمثلة السطحيّة إن كان الموضوع مُعقّداً ويحتوي تفاصيل كثيره ،والمفاهيم هي Data Structures, Containers, Collections وأظنّني أعرف مفهوم الـ Data Structures؟

google translate:

"Just "to" take an idea! What is the difference between these three concepts and if possible some superficial examples if the topic is complex and contains many details, and the concepts are Data Structures, Containers, Collections and I think I know the concept of Data Structures?"
La chose par la chose est rappelé.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Data Structures, Containers, Collections
« Reply #1 on: May 30, 2021, 02:40:37 am »
If you know the concept of Data Structure then you'll know what it refers to: it's any mean of "structuring" data so that it corresponds with the abstract entities which a programmer uses to group data. In that sense, it's almost anything beyond simple types: records, arrrays, lists, classes, etc.

A container is a data structure specialized (i.e. designed) to contain other "simpler" data and data structures like e.g. an array of records, a string list or even a file or database; in Lazarus particularly it's also usually meant as a control which can contain other controls: forms, panels, etc.

Collections and containers are very similar, the differences being mainly that the term "collection" is usually used to refer to containers which store entities of a single type (like a TCollection, where all its members usually have the same base type--see the wiki page on them for an example) and that collections usually maintain references rather than "contain" the entities that form them.

Note also that there is always some overlap in concepts and the distinction depends somehow on who is talking about them; it's frequentely not easy to know whether you're dealing with a collection or a container ... or both! And, of course, all of them are "data structures" in one way or other!

That's, very basically, it in all its muddy "glory" ;)
« Last Edit: May 30, 2021, 02:43:46 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #2 on: May 30, 2021, 02:43:10 pm »
If you know the concept of Data Structure then you'll know what it refers to: it's any mean of "structuring" data so that it corresponds with the abstract entities which a programmer uses to group data. In that sense, it's almost anything beyond simple types: records, arrrays, lists, classes, etc.

A container is a data structure specialized (i.e. designed) to contain other "simpler" data and data structures like e.g. an array of records, a string list or even a file or database; in Lazarus particularly it's also usually meant as a control which can contain other controls: forms, panels, etc.

Collections and containers are very similar, the differences being mainly that the term "collection" is usually used to refer to containers which store entities of a single type (like a TCollection, where all its members usually have the same base type--see the wiki page on them for an example) and that collections usually maintain references rather than "contain" the entities that form them.

Note also that there is always some overlap in concepts and the distinction depends somehow on who is talking about them; it's frequentely not easy to know whether you're dealing with a collection or a container ... or both! And, of course, all of them are "data structures" in one way or other!

That's, very basically, it in all its muddy "glory" ;)

لقد شرحتَها بالـ Old English أو يبدو ذلكـ ،جميل!

google translate:

"You explained it in Old English or it sounds (that) - beautiful!"
La chose par la chose est rappelé.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #3 on: May 30, 2021, 02:45:26 pm »
A TCollection is like a TStringList except it manages a list of TCollectionItem class.

This TCollection can do the basic things like insert a new CollectionItem in the list, delete, search for etc..

A TCollectionItem has information for each item like the Display Name for example.

For the most part, these are classes designed to be inherited from so that you can build a more complete managed handler..

when you create a Tcollection, the constructor requires you to enter the CLASS it will be managing, this will actually point to the class implementation, not just a string name. So it ends as a TCLASS storage property..

 You use collection and collectionitems as part of a more complete class around something you are building..
 
 The object inspector uses this class too.

جيّد! وسأنظُر كذلكـ في الوثائق.

google translate:

"good! I will also look at the documents."
La chose par la chose est rappelé.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Data Structures, Containers, Collections
« Reply #4 on: May 30, 2021, 02:57:56 pm »
You explained it in Old English or it sounds (that) - beautiful!

People is always telling me that I talk like a book, both in my mother tongue and in other languages. For these later it's, I think, because the way I learn them: study the base grammar and a little vocabulary, and then start (and keep on) reading their literature. Makes for a "bookish" kind of result, but I'm glad you find it "beautiful" :D   
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #5 on: May 30, 2021, 03:20:50 pm »
You explained it in Old English or it sounds (that) - beautiful!

People is always telling me that I talk like a book, both in my mother tongue and in other languages. For these later it's, I think, because the way I learn them: study the base grammar and a little vocabulary, and then start (and keep on) reading their literature. Makes for a "bookish" kind of result, but I'm glad you find it "beautiful" :D

إنّها موهبة! لديكـ موهبة. هناكـ أُناسٌ يجدون صُعوبةً في تعلّم حتّى اللغة الأم لديهم ولكن عندما تصِل لمُستوى لُغة الكُتب فقد تخطّيت المُستوى العامّي في فهم اللغة ،فلديكـ فهم والفهم موهبة ولكنّ النّاس الذين لا يُجيدون لُغة الكُتب ففهمهم محدود في ثقافة الشارع والحياة اليوميّة.

google translate:

""It's a" Talent! You have a talent. There are people who find it difficult to learn even their native language, but when you reach the level of the language of books, you have exceeded the general "common" level in understanding the language. You have an understanding and understanding "is a" talent, but people who are not fluent in the language of books, their understanding is limited in street culture and daily life."
La chose par la chose est rappelé.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
« Last Edit: May 30, 2021, 05:40:09 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #7 on: May 30, 2021, 09:34:15 pm »
Also take a look at these:
https://wiki.freepascal.org/Data_Structures,_Containers,_Collections
https://www.tutorialspoint.com/data_structures_algorithms/index.htm
http://www.kau.edu.sa/Files/830/Files/60766_algorithms%20and%20datastructures.pdf
https://forum.lazarus.freepascal.org/index.php?topic=53821.0
https://www.delphipower.xyz/data_structures/

You could also look at this book:
The Tomes of Delphi - Algorithms and Data Structures, by Julian Bucknall

سأنظُر في ذلكـ ،غير أنّ هذا معناه المزيد من الإنجليزيّة ،ليتني كُنتُ أُتقنُ الفرنسيّة أو الإيطاليّة أو الأسبانيّة :D

google translate:

"I will look at it, but this means more English, I wish I could have mastered French, Italian or Spanish :D"
La chose par la chose est rappelé.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Data Structures, Containers, Collections
« Reply #8 on: May 31, 2021, 01:18:25 am »
"I will look at it, but this means more English, I wish I could have mastered French, Italian or Spanish :D"
I am sorry. The only thing I know in Arabic is this: https://forum.lazarus.freepascal.org/index.php?topic=11160.0. However it is about Lazarus in general and not the topic you are interested about.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

egsuh

  • Hero Member
  • *****
  • Posts: 1292
Re: Data Structures, Containers, Collections
« Reply #9 on: May 31, 2021, 03:54:13 am »
AFAIK Data structure is abstract concept and there are lectures with that tile in universities (this is my single formal education on SW engineering).  It contained (in my days) array, linked list, graph, stack, queue, etc., and algorithms to handle them in many applications. 

So can we say collections and containers are kinds of data structure?

cdbc

  • Hero Member
  • *****
  • Posts: 1083
    • http://www.cdbc.dk
Re: Data Structures, Containers, Collections
« Reply #10 on: May 31, 2021, 10:13:39 am »
Hi
Google EZDSL, by Julian M. Bucknall.
... Or you can get it here: https://github.com/cdbc-dk/bc_rtl/tree/master/ezdsl
Regards Benny
« Last Edit: May 31, 2021, 11:20:36 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Data Structures, Containers, Collections
« Reply #11 on: May 31, 2021, 10:41:17 am »
He explained it well in correct English, as it should be.
There are still some out there who try.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #12 on: May 31, 2021, 01:47:02 pm »
Hi
Google EZDSL, by Julian M. Bucknall.
... Or you can get it here: https://github.com/cdbc-dk/bc_rtl/tree/master/ezdsl
Regards Benny

ما هذا؟! هل هذا كتاب أم مجموعة برامج؟ كيف يتم قراءة هذه الملفات؟

google translate:

"What is that?! Is this a book or a program group? How are these files (can be) read?"
La chose par la chose est rappelé.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #13 on: May 31, 2021, 01:50:53 pm »
"I will look at it, but this means more English, I wish I could have mastered French, Italian or Spanish :D"
I am sorry. The only thing I know in Arabic is this: https://forum.lazarus.freepascal.org/index.php?topic=11160.0. However it is about Lazarus in general and not the topic you are interested about.

لا مُشكلة! لقد قُمتُ بتحميل كتابي Motaz النسختين العربيتين.

google translate:

"no problem! I downloaded my Motaz book"s" in Arabic versions."
La chose par la chose est rappelé.

pascal111

  • Sr. Member
  • ****
  • Posts: 423
  • Un trabajo en equipo para programas serias.
Re: Data Structures, Containers, Collections
« Reply #14 on: May 31, 2021, 02:48:11 pm »
"I will look at it, but this means more English, I wish I could have mastered French, Italian or Spanish :D"
I am sorry. The only thing I know in Arabic is this: https://forum.lazarus.freepascal.org/index.php?topic=11160.0. However it is about Lazarus in general and not the topic you are interested about.

سأريكـ شياً! كتاب مُعتز الأوّل والمُسمّى تقريباً Start With ObjPascal يحتوي على شرح لشيء من المُستوى الأساسي في البرمجة ولكن ليس كلّ شيء وإستخدم المؤلف مجموعة من الأمثلة ولا يُشترط أن تكون هذه الأمثلة من النّوع القياسي ثمّ عرّف شيئاً عن البرمجة البنيويّة ثمّ شيئاً عن البرمجة المرئيّة فما قد بدأ به كتابه من أمثلة كان باستخدام الـ console ثمّ عرّف شيئاً عن استخدام الملفات والـ OOP ولكن المواضيع ليست عميقة بالدرجة التي تجعل الكتاب مرجعاً وإنّما مُجرّد مُقدمة بسيطة ليست بالعُمق الكافي ولا تحكي كلّ قدرات اللغة.

في كتابِه الثاني تحت عنوان Second Step With Pascal قدّم شرحاً عن الذّاكرة وبعض الإجراءات معها وربّما الـ pointers ولكن لم يبدو من ذلكـ الفائدة من هذا الموضوع ثمّ قدّم في الكتاب شيئاً من برمجة الويب والشبكات وقواعد البيانات وإدارة الملفات ،لم أقرأ هذه المواضيع بعُمق بعد من صُلب الكتاب لكن أرى أنّ المواضيع مُفكّكة ولن يجد الدّارس طريقة لتنفيذ أفكاره بشكل عملي ،هناكـ نقصٌ في منهج الكتابين وهناكـ جوانب كثيرة مُغفلة. قارن ذلكـ مع وثائق Free Pascal على الرابط https://www.freepascal.org/docs-html/current/ref/ref.html والتي لسوء الحظ بالنّسبة للقارئ العربي مكتوبةً بالإنجليزيّة.

الآن أُنظُر في كتاب يُسمّى Free Pascal From  Square One لـ Jeff Duntemann وهذا الكتاب من إنطباعي الأوّل عنه وقراءتي جزءاً من المقدمة وإلقاء نظرةٍ على بعض الصفحات وشكل الشرح يبدو كتاباً فلسفيّاً في الـ Free Pascal ،هذا كتاب يصلح للقراءة المُتمعّنة ولفهم فلسفة اللغة لكن بالنّسبة للمُبتدئ في اللغة فإنّه يحتاج إلى مُقدمةٍ أسرع قليلاً وعمليّة ثمّ في مرحلةٍ مُتقدمةٍ بإمكانه قراءة هذا الكتاب عندما لا يكون على عجلةٍ من أمره في تعلّم اللغة وقد أخذ فكرةً جيّدةً عن كيفيّة عمل الأمور في اللغة.

هناكـ كتاب آخر حمّلتُه تحت عنوان Beginner's Guide to Lazarus IDE لـ Adnan Shameem والكتاب يُعتبر مُقدمة ضحلة جدّاً في البرمجة فهو أشبه بتعريف الخطوات التي يُمكن أن تتبعها في برمجة مرئيّة لبرنامج بسيط إلى أن تحصل على نسخة تنفيذيّة من برنامجكـ ولكن لا يُعتبر كتاباً شارحاً للغة البرمجة لتعليم البرمجة أو كتاباً تفصيلياً في تعليم بيئة Lazarus ،هو كتاب مُختزل جدّاً.



google translate:

"I'll show you something! Moataz's first book, almost called Start With ObjPascal, contains an explanation of something from the basic level of programming, but not everything. The author used a set of examples and it is not required that these examples be of the standard type. Then he defined something about structural programming and then something about visual programming what he started with His book of examples was using console, then he introduced something about using files and OOP, but the topics are not so deep as to make the book a reference, but rather a simple introduction that is not deep enough and does not tell all the capabilities of the language.

In his second book under the title Second Step With Pascal, he provided an explanation of memory and some procedures with it and perhaps pointers, but it did not seem of benefit from this topic, then he introduced something in the book to web programming, networks, databases and file management. "I didn't read the topics deeply of the core of" The book, but I see that the topics are disjointed, and the student will not find a way to implement his ideas in a practical way. There is a lack of the method of the two books and there are many aspects that are overlooked. Compare this with the Free Pascal documents at https://www.freepascal.org/docs-html/current/ref/ref.html which unfortunately for the Arab reader is written in English.

Now I look at a book called Free Pascal From Square One by Jeff Duntemann, and this book is from my first impression of him "it" "and" My reading is "of" part of the introduction, and I look at some of the pages and the annotation form looks like a philosophical book in the Free Pascal. This is a book suitable for careful reading and understanding the philosophy of language, but for the beginner in Language, he needs a little faster and practical introduction, then at an advanced stage he can read this book when he is in no hurry to learn the language and he has a good idea of ​​how things work in language.

There is another book that I downloaded under the title Beginner's Guide to Lazarus IDE for Adnan Shameem, and the book is considered a very shallow introduction to programming, as it is like defining the steps that you can follow in visual programming for a simple program until you get an executable version of your program, but it is not considered a book explaining the programming language to teach Programming, or a detailed book on the education of Lazarus environment, is a very short book."
« Last Edit: May 31, 2021, 02:57:56 pm by pascal111 »
La chose par la chose est rappelé.

 

TinyPortal © 2005-2018