0% found this document useful (0 votes)
34 views

Stack Queue Tree Graph

Uploaded by

Josua Cagampang
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Stack Queue Tree Graph

Uploaded by

Josua Cagampang
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Stack - ordered list in which insertion Full: Checks if the queue is full.

and deletion are done at one end,


called top.
Ascending Priority Queue: In
Hence, it is called the Last in First
Ascending Priority Queue, the
out (LIFO) or First in Last out (FILO)
elements are arranged in increasing
list.
order of their priority values. Element
When an element is inserted in a with smallest priority value is popped
stack, the concept is called PUSH. first.
element is removed from the stack, Descending Priority Queue: In
the concept is called POP Descending Priority Queue, the
elements are arranged in decreasing
Trying to pop out an empty stack is
order of their priority values. Element
called underflow and trying to push an
with largest priority is popped first.
element in a full stack is called
OVERFLOW Basic Operations of Queue Data
Structure
Enqueue (Insert): Adds an element
QUEUE - is a fundamental concept in
to the rear of the queue.
computer science used for storing and
managing data in a specific order. Dequeue (Delete): Removes and
returns the element from the front of
“First in, First out” (FIFO), where
the queue.
the first element added to the queue is
the first one to be removed. Peek: Returns the element at the
front of the queue without removing it.
Types Of Queue
Empty: Checks if the queue is empty.
- Simple Queue
Full: Checks if the queue is full.
- Double Ended Queue
IMPLEMENTATION OF QUEUES
- Circular Queue
Array
- Priority Queue
LinkedList
Basic Operations of Queue Data
Structure
Enqueue (Insert): Adds an element to TREE
the rear of the queue.
non-linear data structure where data
Dequeue (Delete): Removes and objects are organized in terms of
returns the element from the front of hierarchical
the queue.
relationship.
Peek: Returns the element at the
front of the queue without removing it.
TYPES OF TREE DATA STRUCTURES:
Empty: Checks if the queue is empty.
Binary tree: In a binary tree, each
node can have a maximum of two
children linked to it.

Ternary Tree: A Ternary Tree is a tree


data structure in which each node has
at most three child nodes, usually
distinguished as “left”, “mid” and
“right”.
N-ary Tree or Generic Tree: Generic
trees are a collection of nodes where
each node is a data structure that
consists of records.
General tree -A general tree data
structure has no restriction on the
number of nodes. It means that a
parent node can have any number of
child nodes.
Balanced tree - If the height of the
left sub-tree and the right sub-tree is
equal or differs at most by 1, the tree
is known as a balanced tree.
BASIC OPERATIONS OF TREE DATA
STRUCTURE
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.
Traversal:
Depth-First-Search Traversal
Breadth-First-Search Traversal

You might also like