0% found this document useful (0 votes)
74 views20 pages

A Presentation On: Linear Queue & Binary Search Tree

This document presents information on linear queues and binary search trees. It defines a linear queue as a first-in, first-out data structure and describes two implementations: contiguous and linked. It also defines a binary search tree as a data structure that organizes nodes to keep them in a sorted order and supports fast insertion, deletion and searching of nodes based on their key values. The document outlines the properties and operations of binary search trees, including insertion, deletion and searching of nodes. It concludes with potential areas for future enhancement of the program.

Uploaded by

Saroj Katwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views20 pages

A Presentation On: Linear Queue & Binary Search Tree

This document presents information on linear queues and binary search trees. It defines a linear queue as a first-in, first-out data structure and describes two implementations: contiguous and linked. It also defines a binary search tree as a data structure that organizes nodes to keep them in a sorted order and supports fast insertion, deletion and searching of nodes based on their key values. The document outlines the properties and operations of binary search trees, including insertion, deletion and searching of nodes. It concludes with potential areas for future enhancement of the program.

Uploaded by

Saroj Katwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

A Presentation On

Linear Queue
& Binary Search Tree

Saroj Kumar Katwal


Sandesh Pandit
LINEAR QUEUE
 A queue is a data structure that is somewhat like a stack, except that in a queue the first item
inserted is the first to be removed (First-In-First-Out, FIFO), while in a stack, the last item inserted
is the first to be removed (LIFO). A queue works like a line you wait in. The queue abstract data
type defines a collection that keeps objects in a sequence, where: - element access and deletion are
restricted to the first element in the sequence, which is called the front of the queue, and - element
insertion is restricted to the end of the sequence, which is called the rear of the queue.
 In a linear queue, the traversal through the queue is possible only once,i.e., once an element is
deleted, we cannot insert another element in its position. This disadvantage of a linear queue is
overcome by a circular queue.
 This restriction enforces the rule that items are inserted and deleted in a queue according to the
first-in-first-out (FIFO) principle.
The queue supports the following two fundamental methods:
  Enqueue(e): Insert element e at the rear of the queue (end).
  Dequeue(): Remove and return from the queue the object at the front; an error occurs if the queue
is empty.

 
 Linear Queue Implementation Queue can be implemented in two different ways:
1. Contiguous linear queue: the queue is implemented as an array.
2. Linked linear queue: pointers and dynamic memory allocation is used to implement the queue.

We have implemented the Contiguous linear queue implementation in our project.


Linear Queue
Enqueue
Enqueue
Dequeue
About
BINARY SEARCH TREE

 Binary Search Tree Binary Search Trees (BST), sometimes


called ordered or sorted binary trees, are a particular type
of container: a data structure that stores "items" (such as
numbers, names etc.) in memory. They allow fast lookup,
addition and removal of items, and can be used to
implement either dynamic sets of items, or lookup tables
that allow finding an item by its key (e.g., finding the
phone number of a person by name).
Properties:

 The left subtree of a node contains only nodes with keys lesser than the node’s
key.
 The right subtree of a node contains only nodes with keys greater than the node’s
key.
 The left and right subtree each must also be a binary search tree. Thus, BST
divides all its sub-trees into two segments; the left subtree and the right subtree
and can be defined as : left_subtree (keys) ≤ node (key) ≤ right_subtree (keys)
Binary Search Tree
Insert
Insertion
Deletion
Deletion
Searching
Searching
Future enhancement
Shortcuts can be used for menu.
Modifying the program large number of
data can also be easily handled.
Visual representation can also be
improved .
ANY QUERRIES?
THANK YOU !!

You might also like