You are on page 1of 5

PROFESSIONAL SKILLS –II

Aptitude/ Logic Building

TREE TRAVERSAL

BY:
SHIVAM GADEKAR -
15
MECH - A

REPORT
Professional skills-II
It is a subject which helps a student to build or develop logical thinking. Logical thinking is
the process in which one uses reasoning consistently to come to a conclusion. Problems or
situations that involve logical thinking call for structure, for relationships between facts, and
for chains of reasoning that “make sense”. It allows a child to reject quick answers, such as “I
don’t know,” or “ It’s too difficult,” by empowering them to delve deeper into their thinking
processes and understand better the methods used to arrive at a solution and even the
solution itself.
Basically, Logical thinking is the act of analyzing a situation and coming up with a sensible
solution. Similar to critical thinking, logical thinking requires the use of reasoning skills to
study a problem objectively, which will allow you to make a rational conclusion about how to
proceed. When you use the facts available to you to address a problem you may be facing at
work, for example, you are using logical reasoning skills.
Why are logical thinking skills important?
Logical thinking skills are important because they can help us through the important
decisions, to solve problems, to generate creative ideas and set goals—all of which are
necessary for developing your career. Whether we have just entered the workforce or want to
advance your career, we will come across challenges on a daily basis that require logical
reasoning skills. The stronger your logical thinking skills are, the more easily we will be able
to come up with solutions and plans that benefit us and our workplace.
So, in the initial sections of PS-II students were thought about what is logic building and why
it is important. In the later sections they performed methods on how to build logical thinking.
The teachers provided some problems and situations to find the solution that is logical and
reasonable. Many problems like quiz, riddles and puzzles were solved in the class which
helped us think about the solution logical and thus enhance our logical thinking.
Further the students were told to make presentations in groups on the topics based on logical
Techniques or Thinking such as searching, sorting, etc. The students also presented on their
topics. This session was very helpful as it created confidence on communication skills and in
self- learning about the topic.

AIM:
To study : 1. Introduction to Tree Traversal.
2. What is In order Tree Traversal?
3. What is Pre order?

THEORY:
Tree is basically representation of data in hierarchical form and traversal is to traverse the
data by visiting each node of the tree. Traversal of a tree can be done in many ways.following
are some of these:

Pre-order (NLR)

Depth-first traversal of an example tree:


 pre-order (red): F, B, A, D, C, E, G, I, H;

 in-order (yellow): A, B, C, D, E, F, G, H, I;

 post-order (green): A, C, E, D, B, H, I, G, F.

1. Check if the current node is empty or null.


2. Display the data part of the root (or current node).
3. Traverse the left subtree by recursively calling the pre-order function.
4. Traverse the right subtree by recursively calling the pre-order function.

preorder(node)
if (node == null)
return
visit(node)
preorder(node.left)
preorder(node.right)

In-order (LNR)
1. Check if the current node is empty or null.
2. Traverse the left subtree by recursively calling the in-order function.
3. Display the data part of the root (or current node).
4. Traverse the right subtree by recursively calling the in-order function.
In a binary search tree, in-order traversal retrieves data in sorted order.
In-order

inorder(node)
if (node == null)
return
inorder(node.left)
visit(node)
inorder(node.right)

CONCLUSION
The algorithms above have several use cases in software and development. Below is a list of
some of these common cases:
1) To construct any binary tree, you need the in-order traversal array of nodes and either a
pre-order or post-order array.
2) A binary search tree can be constructed using only its pre-order traversal array.
3) The in-order traversal of a binary search tree produces the elements in sorted order.

4) You can perform a breadth-first search on a tree using a level-order traversal.

THANK YOU

You might also like