Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Data structure
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== {{main article|List of data structures}} [[File:Python 3. The standard type hierarchy.png|thumb|The standard [[Data type|type]] hierarchy of the programming language [[Python_(programming_language) | Python 3]].]] There are numerous types of data structures, generally built upon simpler [[primitive data type]]s. Well known examples are:<ref>{{Cite book|title=Data structures|last=Seymour|first=Lipschutz|date=2014|publisher=McGraw Hill Education|isbn=9781259029967|edition=Revised first|location=New Delhi, India|oclc=927793728}}</ref> * An [[Array (data structure)|array]] is a number of elements in a specific order, typically all of the same type (depending on the language, individual elements may either all be forced to be the same type, or may be of almost any type). Elements are accessed using an integer index to specify which element is required. Typical implementations allocate contiguous memory words for the elements of arrays (but this is not always a necessity). Arrays may be fixed-length or resizable. * A [[linked list]] (also just called ''list'') is a linear collection of data elements of any type, called nodes, where each node has itself a value, and points to the next node in the linked list. The principal advantage of a linked list over an array is that values can always be efficiently inserted and removed without relocating the rest of the list. Certain other operations, such as [[random access]] to a certain element, are however slower on lists than on arrays. * A [[Record (computer science)|record]] (also called ''tuple'' or ''struct'') is an [[aggregate data]] structure. A record is a value that contains other values, typically in fixed number and sequence and typically indexed by names. The elements of records are usually called ''fields'' or ''members''. In the context of [[object-oriented programming]], records are known as [[plain old data structure]]s to distinguish them from objects.<ref>{{cite web|url=http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/doc/POD.html |access-date=6 December 2016 |title=C++ Language Note: POD Types |author=Walter E. Brown |publisher=[[Fermi National Accelerator Laboratory]] |date=September 29, 1999|archive-url=https://web.archive.org/web/20161203130543/http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/doc/POD.html|archive-date=2016-12-03}}</ref> * [[Hash table]]s, also known as hash maps, are data structures that provide fast retrieval of values based on keys. They use a hashing function to map keys to indexes in an array, allowing for constant-time access in the average case. Hash tables are commonly used in dictionaries, caches, and database indexing. However, hash collisions can occur, which can impact their performance. Techniques like chaining and open addressing are employed to handle collisions. * [[Graph (abstract data type)|Graphs]] are collections of nodes connected by edges, representing relationships between entities. Graphs can be used to model social networks, computer networks, and transportation networks, among other things. They consist of vertices (nodes) and edges (connections between nodes). Graphs can be directed or undirected, and they can have cycles or be acyclic. Graph traversal algorithms include breadth-first search and depth-first search. * [[Stack (abstract data type)|Stacks]] and [[queue (abstract data type)|queues]] are abstract data types that can be implemented using arrays or linked lists. A stack has two primary operations: push (adds an element to the top of the stack) and pop (removes the topmost element from the stack), that follow the Last In, First Out (LIFO) principle. Queues have two main operations: enqueue (adds an element to the rear of the queue) and dequeue (removes an element from the front of the queue) that follow the First In, First Out (FIFO) principle. * [[Tree (data structure)|Trees]] represent a hierarchical organization of elements. A tree consists of nodes connected by edges, with one node being the root and all other nodes forming subtrees. Trees are widely used in various algorithms and data storage scenarios. [[Binary tree]]s (particularly [[Heap (data structure)|heap]]s), [[AVL tree]]s, and [[B-tree]]s are some popular types of trees. They enable efficient and optimal searching, sorting, and hierarchical representation of data. A [[trie]], or prefix tree, is a special type of tree used to efficiently retrieve strings. In a trie, each node represents a character of a string, and the edges between nodes represent the characters that connect them. This structure is especially useful for tasks like autocomplete, spell-checking, and creating dictionaries. Tries allow for quick searches and operations based on string prefixes.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)