Micro-Project Proposal: Brief Introduction
Micro-Project Proposal: Brief Introduction
BRIEF INTRODUCTION: -
• A tree is a non-linear data structure used to represent the hierarchical
structure of one or more Elements, which are known as nodes of the tree.
• Each node of a tree stores a data value and has zero or more pointers
pointing to the other nodes of the tree which are known as its child nodes.
• Each node in a tree can have zero or more child nodes, which is at one level
below it. However, each child node can have only one parent node, which
is at one level above it.
• The node at the top of the tree is known as the root of the tree and the nodes
at the lowest level are known as the leaf nodes
In this project, we need to create the binary tree by inserting nodes and
displaying nodes in inorder fashion. A typical binary tree can be represented
as follows:
In the binary tree, each node can have at most two children. Each node can have
zero, one or two children. Each node in the binary tree contains the following
information:
COURSE OUTCOMES: -
CO e. Implement program to create and traverse tree to solve problems.
LITERATURE REVIEW: -
A binary search tree, also known as ordered binary search tree, is a variation of
rooted binary tree in which the nodes are arranged in an order. [1]:298 The nodes
of the tree store a key (and optionally, an associated value), and each has two
distinguished sub-trees, commonly denoted left and right. The tree additionally
satisfies the binary search property: the key in each node is greater than or equal
to any key stored in the left sub-tree, and less than or equal to any key stored in
the right sub-tree.[2]: 287 Thus, BST requires an order relation by which every
node of the tree is comparable with every other node in the sense of total order.
Binary search trees are also efficacious in sorting algorithms and search
algorithms. However, the U search complexity of a BST depends o upon the order
in which the nodes are inserted and deleted; since in worst case, successive
operations in the binary search tree may lead to degeneracy and form a singly
linked list (or “unbalanced tree”) like structure, thus has the same worst-case
complexity as a linked list.[3][1]: 299-302 Binary search trees are also a
fundamental data structure used in construction of abstract data structures such
as sets, multisets, and associative arrays.
Ex. 1)
8
/\
5 9 ---→ this is not a BST
/\ /\
3 241
Ex. 2)
10
/\
5 20 -----→ this is a BST
/\ /\
3 8 15 30
Important Point
When in – order Traversal is done in BST
We get Elements printed in sorted format.
Like if,
In – order Traversal is done in Ex. 2
We get Elements printed as –
3,5,8,10,15,20,30
(only works in BST).
PROPOSED METHODOLOGY: -
• Understand the topic given to us.
• Discuss about the topic with group members.
• Divide the topic throughout each member of the group.
• Collected the information from member and verify from our lecturer.
• Prepared the main report of our micro project.
RESOURCES REQUIRED: -
Sr. Name of Specification Quantity Remarks
No Resources
1. Computer Computer (i3-i5 1
System preferable), RAM
minimum 2GB
2. Operating Windows 10 1
system
3. Turbo C For compiling C 1
program
Action Plan: -
(Third Semester)
In the Subject of
Data Structures Using C (22317)
Submitted By
Tejas Pokale
Yash Gangamwar
Puja jamankar
Vaibhavi Nasare
Tanmay Zalke
Sujal Thaware
Submitted To
Prof. H. Ranotkar
Lecturer In
(2021-2022)
Certificate
This is to certify, that students whose name mention below of Third
Semester of Diploma in Computer Engineering has satisfactorily
completed the Micro project entitled “Develop a “C” program that
creates a tree to store given data set using Linked List. Locate and
display Specific data from data Set” in Data Structures Using C or the
academic year 2021-22 as Prescribed in MSBTE curriculum.
Place: Arvi
Date:
We under signed hereby declare that the micro project report entitled “Develop
a C program that creates a tree to store given data set using Linked List.
Locate and display Specific data from data set”. I further declare that contents
of this report are properly citied and well acknowledge. This present report is not
submitted to any other examination of this or any other institute for the award of
any diploma.
Place: Arvi
Date:
(Signature)
----------------------------
----------------------------
----------------------------
----------------------------
----------------------------
RATIONALE: -
The representation we use singly linked list. In this representation each node
requires three fields,
When A node has no child then the corresponding pointer fields are null. The left
and right field of a node is pointer to left and the right child of that node.
LITERATURE REVIEW: -
A binary search tree, also known as ordered binary search tree, is a
variation of rooted binary tree in which the nodes are arranged in an
order. [1]:298 The nodes of the tree store a key (and optionally, an
associated value), and each has two distinguished sub-trees, commonly
denoted left and right. The tree additionally satisfies the binary search
property: the key in each node is greater than or equal to any key stored
Ex. 1)
8
/\
5 9 ---→ this is not a BST
/\ /\
3 241
Ex. 2)
10
Important Point
When in – order Traversal is done in BST
We get Elements printed in sorted format.
Like if,
In – order Traversal is done in Ex. 2
We get Elements printed as –
3,5,8,10,15,20,30
(only works in BST).
Important Point
Searching in BST is very fast,as we remove half the Elements
From search scope.
Best time / Average time complexity : O(log n)
Worst time complexity : O(n)
All the group members had performed and done their work Correctly.
3] Puja Jamankar also provided information and has worked on action plan and
application of these Microproject.
4] Vaibhavi Nasare has Provided information about the skills developed in these
Microproject and learning outcome of these Microproject.
5] Tanmay Zalke and Sujal Thaware has provided information about the area of
future development of these Microproject.
Algorithm: -
e. If the left child is not present, it will add the new node as
the left child.
f. If the left is present, then it will add the new node as the
right child.
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
Typedef struct Node {
Int data ;
Struct Node *left ;
Struct Node *right ;
} Tree ;
//NODE CREATOR
Tree * create(int data){
Tree *ptr = (Tree*) malloc(sizeof(Tree)) ;
Ptr -> data = data ;
Ptr -> left = NULL ;
Ptr -> right = NULL ;
Return ptr ;
}
//Function to insert data in BST
Void insert(Tree **root , int val){
If((*root) == NULL)
}
Tree * minValueNode (Tree * root){
Tree * current = root ;
While(current -> left != NULL)
Current = current -> left ;
Return current ;
}
//Function to remove data from bst
Tree * remove (Tree *root , int val){
If(root == NULL)
Return root ;
Else{
If( root -> data > val)
Root -> left = remove(root -> left , val) ;
Else if(root -> data < val)
Root -> right = remove(root-> right , val) ;
Else {
If(root -> left == NULL){
Tree *temp = root -> right ;
Free(root) ;
References
➢ https://www.javatpoint.come
➢ https://www-geeksforgeeks-org.s
➢ https://en.m.wikipedia.e
Conclusion
Thus , we have created tree (Binary Search Tree) using linked List i.e. (each
Node will be dynamically created) in a menu driven program and taken user
input to store and display the data accordingly.
We also performed most effective work for which trees are used (searching)
using both iterative and recursive method .