types of data structures
types of data structures
Array
2. Linked List
● Definition: A linear data structure where each element (node) contains a value and a
reference (link) to the next node in the sequence.
3. Stack
● Definition: A linear data structure that follows the Last In, First Out (LIFO) principle,
where elements are added and removed from the same end.
4. Queue
● Definition: A linear data structure that follows the First In, First Out (FIFO) principle,
where elements are added at the rear and removed from the front.
● Definition: A linear data structure that allows insertion and deletion of elements from
both ends.
● Definition: A data structure that stores key-value pairs, using a hash function to
compute an index into an array of buckets or slots, from which the desired value can be
found.
7. Binary Tree
● Definition: A tree data structure in which each node has at most two children, referred to
as the left child and the right child.
● Definition: A binary tree in which each node has a key greater than all the keys in its left
subtree and less than all the keys in its right subtree.
9. AVL Tree
● Definition: A self-balancing binary search tree where the difference in heights of left and
right subtrees of any node is at most one.
● Definition: A self-balancing binary search tree where each node contains an extra bit for
denoting the color of the node, which can be either red or black.
11. B-Tree
● Definition: A self-balancing tree data structure that maintains sorted data and allows
searches, sequential access, insertions, and deletions in logarithmic time.
12. B+ Tree
● Definition: A type of self-balancing tree where all values are present in the leaf nodes
and internal nodes store only keys for guiding the search.
● Definition: A complete binary tree where the value of each node is greater than or equal
to the values of its children.
● Definition: A complete binary tree where the value of each node is less than or equal to
the values of its children.
● Definition: A tree-like data structure used to store a dynamic set of strings, where each
node represents a common prefix shared by some strings.
16. Graph
● Definition: A collection of nodes (vertices) and edges connecting pairs of nodes, used to
represent networks of relationships.
● Definition: A 2D array used to represent a graph, where each element indicates whether
there is an edge between a pair of vertices.
19. Set
● Definition: A collection of elements that allows for multiple occurrences of the same
element.
● Definition: An abstract data type similar to a regular queue or stack, but where each
element has a priority and the element with the highest priority is served first.
● Definition: A data structure that keeps track of a partition of a set into disjoint subsets,
supporting union and find operations.
● Definition: A data structure used to answer range minimum queries in constant time
with preprocessing time of O(nlogn)O(n \log n)O(nlogn).
● Definition: A tree data structure used for storing intervals or segments and allowing for
efficient querying and updating of these intervals.
● Definition: A data structure that provides efficient methods for cumulative frequency
tables and can be used for querying and updating frequency tables in logarithmic time.
● Definition: A compressed trie of all suffixes of a given text, used in string processing
applications.
● Definition: A data structure that allows fast search within an ordered sequence of
elements, using multiple levels of linked lists.
30. Matrix