Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 A ) i ) Construct the Expression tree using the stack for the following and also describe the steps for implementing the same and

5A) i) Construct the Expression tree using the stack for the following and also describe the steps for
implementing the same and traverse the tree and provide the infix, postfix and prefix order traversal
of the constructed expression tree using stack for the following expressions.
(5-z-8)*(42) also evaluate the expression tree when z=20
((true V false)??? false)vv(true V false)
ab+cde+**
(2a+5b)3?*(x-7y)4
ii) Construct the Binary search tree (BST) for the following and provide the Post-order, In-order, and
Pre-order traversal of the following:
a) Given the post order A C E D B H I G F construct the BST and outline the In-order and Post order
tree traversal.
b) Given the pre-order traversal order of the tree 20,16,5,18,17,19,60,85,70 construct the BST
and provide the In-order and Post order tree traversal.
5B) Outline the definition of sparse matrix. Implement the C++ User defined function to implement the
Sparse matrix addition and multiplication?
5C) Write the user defined functions to merge the 2 binary trees? What problems you will face if you
merge two binary trees of numerical elements which are represented using A single array.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions