Структура података — разлика између измена

С Википедије, слободне енциклопедије
Садржај обрисан Садржај додат
.
Ред 1: Ред 1:
{{short description|Посебан начин чувања и организовања података у рачунару}}
'''Структура података''', начин представљања [[податак]]а у [[Примарна меморија|рачунарској меморији]], којим се омогућује њихово лако представљање и обрада. Најбитније структуре су: низови, уланчане листе, стекови, редови, приоритетни редови, графови, бинарни и m-арна стабла.
[[Image:Hash table 3 1 1 0 1 0 0 SP.svg|thumb|315px|Структура података позната као [[хеш табела]].<ref name="ms">{{citation|contribution=4 Hash Tables and Associative Arrays|title=Algorithms and Data Structures: The Basic Toolbox|first1=Kurt|last1=Mehlhorn|author1-link=Kurt Mehlhorn|first2=Peter|last2=Sanders|author2-link=Peter Sanders (computer scientist)|publisher=Springer|year=2008|pages=81–98 |url=http://people.mpi-inf.mpg.de/~mehlhorn/ftp/Toolbox/HashTables.pdf}}</ref>]]

'''Структура података''', начин представљања [[податак]]а у [[Примарна меморија|рачунарској меморији]], којим се омогућује њихово лако представљање и обрада.<ref>{{Cite book|url=https://dl.acm.org/citation.cfm?id=1614191|title=Introduction to Algorithms, Third Edition|last=Cormen|first=Thomas H.|last2=Leiserson|first2=Charles E.|last3=Rivest|first3=Ronald L.|last4=Stein|first4=Clifford|date=2009|publisher=The MIT Press|isbn=978-0262033848|edition=3rd}}</ref><ref>{{cite book |last1=Black |first1=Paul E. |editor1-last=Pieterse |editor1-first=Vreda |editor2-last=Black |editor2-first=Paul E. |title=Dictionary of Algorithms and Data Structures [online] |date=15 December 2004 |publisher=[[National Institute of Standards and Technology]] |chapter-url=https://xlinux.nist.gov/dads/HTML/datastructur.html |access-date=2018-11-06 |chapter=data structure}}</ref><ref>{{cite encyclopedia |encyclopedia=Encyclopaedia Britannica |title= Data structure |url=https://www.britannica.com/technology/data-structure |access-date=2018-11-06 |date=17 April 2017}}</ref> Тачније, структура података је скуп вредности података, односа међу њима и функција или операција које се могу применити на податке,<ref>{{Cite book|url=http://dl.acm.org/citation.cfm?id=1074100.1074312|title=Encyclopedia of Computer Science|last=Wegner|first=Peter|last2=Reilly|first2=Edwin D.|publisher=John Wiley and Sons |isbn=978-0470864128|location=Chichester, UK|pages=507–512|date=2003-08-29}}</ref> тј. то је [[algebraic structure|алгебарска структура]] о [[data|подацима]]. Најбитније структуре су: низови, уланчане листе, стекови, редови, приоритетни редови, графови, бинарни и m-арна стабла.

== Употреба ==
{{рут}}
Data structures serve as the basis for [[abstract data type]]s (ADT). The ADT defines the logical form of the data type. The data structure implements the physical form of the [[data type]].<ref>{{cite web |title=Abstract Data Types |url=https://opendsa-server.cs.vt.edu/ODSA/Books/CS3/html/ADT.html |website=Virginia Tech - CS3 Data Structures & Algorithms}}</ref>

Different types of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, [[Relational database|relational databases]] commonly use [[B-tree]] indexes for data retrieval,<ref>{{cite book|chapter-url=http://searchsecurity.techtarget.com/generic/0,295582,sid87_gci1184450,00.html|title=Beginning Database Design|isbn=978-0-7645-7490-0|author=Gavin Powell|chapter=Chapter 8: Building Fast-Performing Database Models|publisher=[[Wrox Press|Wrox Publishing]]|year=2006}}</ref> while [[compiler]] [[Implementation|implementations]] usually use [[hash table]]s to look up identifiers.<ref>{{cite web |title=1.5 Applications of a Hash Table |url=http://www.cs.uregina.ca/Links/class-info/210/Hash/ |website=University of Regina - CS210 Lab: Hash Table |access-date=2018-06-14 |archive-date=2021-04-27 |archive-url=https://web.archive.org/web/20210427183057/https://www.cs.uregina.ca/Links/class-info/210/Hash/ |url-status=dead }}</ref>

Data structures provide a means to manage large amounts of data efficiently for uses such as large [[database]]s and internet indexing services. Usually, efficient data structures are key to designing efficient [[algorithm]]s. Some formal design methods and [[programming language]]s emphasize data structures, rather than algorithms, as the key organizing factor in software design. Data structures can be used to organize the storage and retrieval of information stored in both [[main memory]] and secondary memory.<ref>{{cite web |title=When data is too big to fit into the main memory |url=http://homes.sice.indiana.edu/yye/lab/teaching/spring2014-C343/datatoobig.php |website=homes.sice.indiana.edu}}</ref>


== Низови ==
== Низови ==
Ред 30: Ред 41:
== Остале структуре ==
== Остале структуре ==
Поред ових структура, које су најчешће, постоји велики број структура које су модификација ових, и које се користе за различите потребе.
Поред ових структура, које су најчешће, постоји велики број структура које су модификација ових, и које се користе за различите потребе.

== Референце ==
{{Reflist|}}

== Литература ==
{{Refbegin|30em}}
* Peter Brass, ''Advanced Data Structures'', [[Cambridge University Press]], 2008, {{ISBN|978-0521880374}}
* [[Donald Knuth]], ''[[The Art of Computer Programming]]'', vol. 1. [[Addison-Wesley]], 3rd edition, 1997, {{ISBN|978-0201896831}}
* Dinesh Mehta and [[Sartaj Sahni]], ''Handbook of Data Structures and Applications'', [[Chapman and Hall]]/[[CRC Press]], 2004, {{ISBN|1584884355}}
* [[Niklaus Wirth]], ''Algorithms and Data Structures'', [[Prentice Hall]], 1985, {{ISBN|978-0130220059}}
* [[Alfred Aho]], [[John Hopcroft]], and [[Jeffrey Ullman]], ''Data Structures and Algorithms'', Addison-Wesley, 1983, {{ISBN|0-201-00023-7}}
* [[Gaston Gonnet|G. H. Gonnet]] and [[Ricardo Baeza-Yates|R. Baeza-Yates]], ''[https://users.dcc.uchile.cl/~rbaeza/handbook/hbook.html Handbook of Algorithms and Data Structures - in Pascal and C]'', second edition, Addison-Wesley, 1991, {{ISBN|0-201-41607-7}}
* [[Ellis Horowitz]] and Sartaj Sahni, ''Fundamentals of Data Structures in Pascal'', [[Computer Science Press]], 1984, {{ISBN|0-914894-94-3}}
* {{cite book |last1=Cormen |first1=Thomas H. |author1-link=Thomas H. Cormen |last2=Leiserson |first2=Charles E. |author2-link=Charles E. Leiserson |last3=Rivest |first3=Ronald L. |author3-link=Ronald L. Rivest |last4=Stein |first4=Clifford |author4-link=Clifford Stein | title = Introduction to Algorithms | edition = 3rd | publisher = Massachusetts Institute of Technology | year = 2009 | isbn = 978-0-262-03384-8 | pages = 253–280 |title-link=Introduction to Algorithms }}
* {{cite book | first=Donald |last=Knuth |author1-link=Donald Knuth | title = The Art of Computer Programming | volume = 3: ''Sorting and Searching'' | edition = 2nd | publisher = Addison-Wesley | year = 1998 | isbn = 978-0-201-89685-5 | pages = 513–558 }}
* {{cite book |last1=Cormen |first1=Thomas H. |author1-link=Thomas H. Cormen |last2=Leiserson |first2=Charles E. |author2-link=Charles E. Leiserson |last3=Rivest |first3=Ronald L. |author3-link=Ronald L. Rivest |last4=Stein |first4=Clifford |author4-link=Clifford Stein | title = Introduction to Algorithms | publisher = MIT Press and McGraw-Hill | year= 2001 | isbn = 978-0-262-53196-2 | edition = 2nd | pages=[https://archive.org/details/introductiontoal00corm_691/page/n243 221]–252 | chapter = Chapter 11: Hash Tables |title-link=Introduction to Algorithms }}
* {{cite book|title=Handbook of Datastructures and Applications|url=https://www.taylorfrancis.com/books/mono/10.1201/9781420035179/handbook-data-structures-applications-dinesh-mehta-dinesh-mehta-sartaj-sahni|publisher=[[Taylor & Francis]]|isbn=978-1-58488-435-4|first1=Dinesh P. |chapter=9: Hash Tables|last1=Mehta |first2=Sartaj |last2=Sahni | author2-link = Sartaj Sahni|date=28 October 2004|edition=1|doi=10.1201/9781420035179}}
* {{cite book|title=Hashing in Computer Science: Fifty Years of Slicing and Dicing|publisher=[[John Wiley & Sons, Inc.]]|first=Alan G.|last=Konheim|date=21 June 2010|isbn=9780470630617|doi=10.1002/9780470630617|url=https://onlinelibrary.wiley.com/doi/book/10.1002/9780470630617}}
* {{citation | last1 = Lu | first1 = Yi | last2 = Prabhakar | first2 = Balaji | last3 = Bonomi | first3 = Flavio | doi = 10.1109/ISIT.2006.261567 | journal = 2006 IEEE International Symposium on Information Theory | pages = 2774–2778 | title = Perfect Hashing for Network Applications | year = 2006| isbn = 1-4244-0505-X | s2cid = 1494710 }}
* {{citation | last1 = Belazzougui | first1 = Djamal | last2 = Botelho | first2 = Fabiano C. | last3 = Dietzfelbinger | first3 = Martin | contribution = Hash, displace, and compress | contribution-url = http://cmph.sourceforge.net/papers/esa09.pdf | doi = 10.1007/978-3-642-04128-0_61 | location = Berlin | mr = 2557794 | pages = 682–693 | publisher = Springer | series = [[Lecture Notes in Computer Science]] | title = Algorithms—ESA 2009: 17th Annual European Symposium, Copenhagen, Denmark, September 7-9, 2009, Proceedings | volume = 5757 | year = 2009| citeseerx = 10.1.1.568.130 | url = http://cmph.sourceforge.net/papers/esa09.pdf }}
* {{cite journal|journal= Information and Software Technology |volume=45|issue=2|date=1 February 2003|doi=10.1016/S0950-5849(02)00174-X|url=https://www.sciencedirect.com/science/article/abs/pii/S095058490200174X|title= Empirical studies of some hashing functions |via=[[ScienceDirect]]|first=Olumide|last=Owolabi|pages=109–112 |publisher= Department of Mathematics and Computer Science, University of Port Harcourt}}
* {{cite book|title=Robin Hood Hashing|first=Pedro|last=Celis|publisher=[[University of Waterloo]], Dept. of Computer Science|year=1986|url=https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf |location=Ontario, Canada|isbn= 031529700X|oclc= 14083698|archive-url=https://web.archive.org/web/20211101071032/https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf|archive-date=1 November 2021|access-date=2 November 2021|url-status=live}}
* {{cite journal|publisher=[[Cambridge University Press]]|date=14 August 2018|first1=P.V.|last1=Poblete|first2=A.|last2=Viola|journal=[[Combinatorics, Probability and Computing]]|volume=28|issue=4|title=Analysis of Robin Hood and Other Hashing Algorithms Under the Random Probing Model, With and Without Deletions|pages=600–617 |doi=10.1017/S0963548318000408|s2cid=125374363 |url=https://www.cambridge.org/core/journals/combinatorics-probability-and-computing/article/abs/analysis-of-robin-hood-and-other-hashing-algorithms-under-the-random-probing-model-with-and-without-deletions/933D4F203E3C70EF15053287412242E0|via=Cambridge Core|access-date=1 November 2021|issn= 1469-2163}}
* {{cite web|url=https://www.cs.cornell.edu/courses/cs3110/2014fa/lectures/13/lec13.html|title= Lecture 13: Hash tables|publisher=[[Cornell University]], Department of Computer Science|first=Michael|last=Clarkson|access-date=1 November 2021|year=2014|archive-url=https://web.archive.org/web/20211007011300/https://www.cs.cornell.edu/courses/cs3110/2014fa/lectures/13/lec13.html|archive-date=7 October 2021|url-status=live|via=cs.cornell.edu}}
* {{cite web|publisher=[[Cornell University]], Department of Computer Science|url=https://www.cs.cornell.edu/courses/JavaAndDS/files/hashing_RobinHood.pdf|title=JavaHyperText and Data Structure: Robin Hood Hashing|access-date=2 November 2021|first=David|last=Gries|year=2017|archive-url=https://web.archive.org/web/20210426051503/http://www.cs.cornell.edu/courses/JavaAndDS/files/hashing_RobinHood.pdf|archive-date=26 April 2021|url-status=live|via=cs.cornell.edu}}
* {{cite techreport|first=Pedro|last=Celis|date=28 March 1988| number=246|institution=[[Indiana University]], Department of Computer Science|location=Bloomington, Indiana| url=https://legacy.cs.indiana.edu/ftp/techreports/TR246.pdf|archive-url=https://web.archive.org/web/20211103013505/https://legacy.cs.indiana.edu/ftp/techreports/TR246.pdf|archive-date=2 November 2021|access-date=2 November 2021|url-status=live| title=External Robin Hood Hashing}}
* {{cite book |last1=Tamassia |first1=Roberto |title=Data structures and algorithms in Java : [updated for Java 5.0] |url=https://archive.org/details/datastructuresal00good_183 |url-access=limited |year=2006 |publisher=Wiley |location=Hoboken, NJ |isbn=978-0-471-73884-8 |pages=[https://archive.org/details/datastructuresal00good_183/page/n368 369]–418 |edition=4th |first2=Michael T. |last2=Goodrich |chapter=Chapter Nine: Maps and Dictionaries}}
* {{cite journal|last1=McKenzie|first1=B. J. |first2=R. |last2=Harries |first3=T. |last3=Bell |title=Selecting a hashing algorithm |journal=Software: Practice and Experience |date=Feb 1990 |volume=20 |issue=2 |pages=209–224 |doi=10.1002/spe.4380200207|hdl=10092/9691 |s2cid=12854386 |hdl-access=free }}

{{refend}}


== Спољашње везе ==
== Спољашње везе ==
{{Commonscat|Data structures}}
{{Commonscat|Data structures}}
* [https://web.archive.org/web/20050624234059/http://www.nist.gov/dads/ Descriptions] from the [[Dictionary of Algorithms and Data Structures]]
* [http://www.cs.auckland.ac.nz/software/AlgAnim/ds_ToC.html Data structures course]
* [http://msdn.microsoft.com/en-us/library/aa289148(VS.71).aspx An Examination of Data Structures from .NET perspective]
* [http://people.cs.vt.edu/~shaffer/Book/C++3e20110915.pdf Schaffer, C. ''Data Structures and Algorithm Analysis'']


{{нормативна контрола}}
{{нормативна контрола}}

Верзија на датум 25. децембар 2022. у 20:45

Структура података позната као хеш табела.[1]

Структура података, начин представљања података у рачунарској меморији, којим се омогућује њихово лако представљање и обрада.[2][3][4] Тачније, структура података је скуп вредности података, односа међу њима и функција или операција које се могу применити на податке,[5] тј. то је алгебарска структура о подацима. Најбитније структуре су: низови, уланчане листе, стекови, редови, приоритетни редови, графови, бинарни и m-арна стабла.

Употреба

Data structures serve as the basis for abstract data types (ADT). The ADT defines the logical form of the data type. The data structure implements the physical form of the data type.[6]

Different types of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks. For example, relational databases commonly use B-tree indexes for data retrieval,[7] while compiler implementations usually use hash tables to look up identifiers.[8]

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services. Usually, efficient data structures are key to designing efficient algorithms. Some formal design methods and programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design. Data structures can be used to organize the storage and retrieval of information stored in both main memory and secondary memory.[9]

Низови

Као елементарне структуре могли би се навести низови - мада, неко се можда неће сложити да су низови структуре. Низови су структуре података које се могу користити за чување великог броја истородних података. У рачунарској меморији се углавном реализују као континуални меморијски блокови. Директан приступ је веома ефикасан, као и секвенцијалан. Такође, постоји велики број ефикасних алгоритама за претраживање низова и уређивање низова по неком критеријуму. На пример: ако је адреса почетка низа А, а тражи се i-ти елемент низа, до њега се долази веома једноставно

a[i] = вредност_локације (A + i * величина_појединачног_елемента_низа)

Мане низова су веома захтевно уметање елемената између два већ постојећа, њихово брисање (потребно је померити све елементе низа од места где се умећу једно место према крају низа).

Листе

И листе спадају међу једноставне структуре, са истом сврхом као и низови али различите имплементације. Сваки елемент листе, поред податка, чува и показивач на следећи елемент листе. Појединачни елементи листе могу се произвољно алоцирати и деалоцирати. Што се тиче ефикасности, ефикаснији су од низова у појединим случајевима. Секвенцијалан приступ је ефикасан, али директан није, јер је потребно да се прође кроз све елементе листе ради добављања податка. Уметање елемената у листу је такође једноставно, као и брисање.

Стекови

Стек је структура података, над којом се могу извршити две операције: операција смештања на стек (push), и операција узимања са стека (pop). Ова структура је посебна по томе што се елемент који је последњи стављен на стек, први се уклања са стека. Стекови су врло чести у рачунарству - скоро сваки процесор подржава коришћење меморије као стека, јер се користе за памћење адреса при скоку у друге потпрограме, за чување података, итд.

Редови

Слично стековима, и над редовима се могу вршити две операције: уметање у ред (Insert) и операција уклањања из реда (delete). Разлика у односу на стек је само у томе што се, из реда узима елемент који је најдуже провео чекајући у реду. И редови су чести у рачунарству: користе се организовање различитих активности током извршавања програма. Приоритетни редови се од обичних разликују по томе што се при уметању податка у ред, податку додељује приоритет, а при вађењу из реда, из реда се узима елемент са најмањим/највећим приоритетом.

Стабла

Стабла су структуре података, које одржавају релације међу подацима. Подаци су организовани тако, да постоји један податак (корен стабла), који је у релацији са подацима који су на следећем нивоу, а ови у релацији са подацима на следећем нивоу. Сваки податак има једног родитеља (сем корена), и ниједно, једно или више деце. Назив је настао, јер цртањем овакве структуре на папиру добија се изглед наопаког стабла. Стабла се у рачунарству користе за моделирање података који су у оваквим односима, као и на пример за: ефикасно рачунање аритметичких израза, стабла одлучивања (програмирање оваквог типа игара: шах, икс-окс...). Поред овог, постоје посебне модификације стабала које служе за брзо претраживање по скупу података: висински балансирана стабла, Б стабла итд.

Графови

Графови су уопштења бинарних стабала. Сваки податак може бити у релацији са произвољним бројем података. Користе се, на пример, за одређивање најкраћег пута између два града, максимизацију протока, итд.

Остале структуре

Поред ових структура, које су најчешће, постоји велики број структура које су модификација ових, и које се користе за различите потребе.

Референце

  1. ^ Mehlhorn, Kurt; Sanders, Peter (2008), „4 Hash Tables and Associative Arrays”, Algorithms and Data Structures: The Basic Toolbox (PDF), Springer, стр. 81—98 
  2. ^ Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2009). Introduction to Algorithms, Third Edition (3rd изд.). The MIT Press. ISBN 978-0262033848. 
  3. ^ Black, Paul E. (15. 12. 2004). „data structure”. Ур.: Pieterse, Vreda; Black, Paul E. Dictionary of Algorithms and Data Structures [online]. National Institute of Standards and Technology. Приступљено 2018-11-06. 
  4. ^ „Data structure”. Encyclopaedia Britannica. 17. 4. 2017. Приступљено 2018-11-06. 
  5. ^ Wegner, Peter; Reilly, Edwin D. (2003-08-29). Encyclopedia of Computer Science. Chichester, UK: John Wiley and Sons. стр. 507—512. ISBN 978-0470864128. 
  6. ^ „Abstract Data Types”. Virginia Tech - CS3 Data Structures & Algorithms. 
  7. ^ Gavin Powell (2006). „Chapter 8: Building Fast-Performing Database Models”. Beginning Database Design. Wrox Publishing. ISBN 978-0-7645-7490-0. 
  8. ^ „1.5 Applications of a Hash Table”. University of Regina - CS210 Lab: Hash Table. Архивирано из оригинала 2021-04-27. г. Приступљено 2018-06-14. 
  9. ^ „When data is too big to fit into the main memory”. homes.sice.indiana.edu. 

Литература

Спољашње везе