1/126
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
DATA
“raw facts”, information, in a form of numbers, text, images, figures, or any other format, structure or unstructured.
STRUCTURE
something arranged in a definite pattern of organization
Data Structures
A specific way of organizing data in a specialized format on a computer so that the information can be organized, processed, stored, and retrieved quickly and effectively.
NON LINEAR
data elements are not placed sequentially or linearly. In this data structure, we can’t traverse all the elements in a single run only. E.g. data structures are trees and graphs, etc.
Static data structure has a fixed memory size. It is easier to access the elements in a static data structure. An example of this data structure is an array.
DYNAMIC
in this data structure, the size is not fixed. It can be randomly updated during the runtime which may be considered efficient concerning the memory (space) complexity of the code. Examples of this data structure are queue, stack, etc
this data structures consist of the same data element type, like element collections found in an array.
NON HOMOGENOUS
the data don’t have to be the same type, such as Linked List.
Arrays
is a collection of items of same data type stored at contiguous memory locations.
Array element
are items stored in an array and can be accessed by their index.
Array Length
is determined by the number of elements it can contain.
One dimensional array
You can imagine a 1d array as a row, where elements are stored one after another.
Two-dimensional array
Multidimensional arrays can be considered as an array of arrays or as a matrix consisting of rows and columns.
Three dimensional array
A Multidimensional array contains three dimensions, so it can be considered an array of two-dimensional arrays.
Single linked list
each node contains a reference to the next node in the sequence. Traversing a ____ linked list is done in a forward direction.
Insertion
Adding a new node to a linked list involves adjusting the pointers of the existing nodes to maintain the proper sequence. can be performed at the beginning, end, or any position within the list.
Deletion
Removing a node from a linked list requires adjusting the pointers of the neighboring nodes to bridge the gap left by the deleted node. can be performed at any position within the list.
is a linear data structure that follows a particular order in which the operations are performed. ▪ The order may be LIFO (Last In First Out) or FILO(First In Last Out).
Dynamic Sized Stack
this stack can grow or shrink dynamically. When the stack is full, it automatically increases its size to accommodate the new element, and when the stack is empty, it decreases its size
Types of Stack Operations
push(), pop(), top(), isEmpty(), size()
Array-based implementation
the push operation is implemented by incrementing the index of the top element and storing the new element at that index
Linked list based implementation
the push operation is implemented by creating a new node with the new element and setting the next pointer of the current top node to the new node
Double Ended Queue (Dequeue)
In a ____________ the insertion and deletion operations, both can be performed from both ends.
Priority Queue
is a special queue where the elements are accessed based on the priority assigned to them.
Enqueue()
Adds (or stores) an element to the end of the queue.
Dequeue()
Removal of elements from the queue.
rear()
This operation returns the element at the rear end without removing it.
isFull()
Validates if the queue is full.
isNull()
Checks if the queue is empty.
TREE
this data structure is a hierarchical structure that is used to represent and organize data in a way that is easy to navigate and search.
Parent Node
The node which is a predecessor of a node is called the _____ node of that node. {B} is the parent node of {D, E}.
Child Node
The node which is the immediate successor of a node is called the ____ node of that node. Examples
Root Node
The topmost node of a tree or the node which does not have any parent node is called the ______. {A} is the _________ of the tree. A non-empty tree must contain exactly one root node and exactly one path from the root to all other nodes of the tree.
Leaf Node or External Node
The nodes which do not have any child nodes are called ___ nodes. {K, L, M, N, O, P} are the leaf nodes of the tree.
Ancestor of a Node
Any predecessor nodes on the path of the root to that node are called ____ of that node. {A,B} are the ancestor nodes of the node {E}.
Descendant
Any successor node on the path from the leaf node to that node. {E,I} are the _____ of the node {B}.
Sibling
Children of the same parent node are called ___. {D,E} are called ___.
Internal node
A node with at least one child is called _____ Node.
Neighbour of a Node
Parent or child nodes of that node are called _____ of that node.
Types of Tree
BINARY, TERNARY, N-ary/Generic Generic
BINARY
In this tree, each node can have a maximum of two children linked to it.
TERNARY
is a tree data structure in which each node has at most three child nodes, usually distinguished as “left”, “mid” and “right”
N-ary/Generic
this tree are a collection of nodes where each node is a data structure that consists of records and a list of references to its children (duplicate references are not allowed).
Create
Create a tree in the data structure.
Insert
Inserts data in a tree.
Search
Searches specific data in a tree to check whether it is present or not.
Preorder Traversal
Traveling a tree in a pre order manner in the data structure.
In order Traversal
Traveling a tree in an in-order manner
Post order Traversal
Traveling a tree in a post-order manner.
GRAPH
is a non-linear data structure consisting of vertices and edges.
VERTICES
are the fundamental units of the graph. Sometimes, ______ are also known as vertex or nodes. Every node/vertex can be labeled or unlabeled.
EDGES
are drawn or used to connect two nodes of the graph. It can be ordered pair of nodes in a directed graph.
Null Graph
A graph is known as a ___ graph if there are no edges in the graph.
Trivial Graph
Graph having only a single ____, it is also the smallest graph possible.
Connected Graph
The graph in which from one node we can visit any other node in the graph is known as a ____ graph.
Disconnected Graph
The graph in which at least one node is not reachable from a node
Regular Graph
The graph in which the degree of every vertex is equal to K is called K ____ graph.
Cyclic Graph
A graph containing at least one cycle is known as a ____ graph.