Skip to content

Ganz1285/arithmetic_tree_representation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Math Operations in Tree Representation

Overview

To Represent a Mathematical Operation and flow of processes in a tree.

Problem Statement

  • Track and represent the flow of math operations in a tree.

Requirements

  • python 3.0 or above

Working

Run python3 tree_operation_representation.py

Input Arithmetic Operation:(8-10+(55/11)*21-99+(79*21/1000)) 
8 - 10 + 55 / 11 * 21 - 99 + 79 * 21 / 1000
---------------------------------------------------------------
55 11
 \//
  5
---------------------------------------------------------------
8 - 10 + 5 * 21 - 99 + 79 * 21 / 1000
---------------------------------------------------------
79    21
 \ *  /
  1659
---------------------------------------------------------
8 - 10 + 5 * 21 - 99 + 1659 / 1000
------------------------------------------------------
1659 1000
   \//
    1
------------------------------------------------------
8 - 10 + 5 * 21 - 99 + 1
--------------------------------------------
5   21
\ * /
 105
--------------------------------------------
8 - 10 + 105 - 99 + 1
-------------------------------
8  10
\- /
 -2
-------------------------------
-2 + 105 - 99 + 1
---------------------------
-2   105
 \ + /
  103
---------------------------
103 - 99 + 1
----------------------
103 99
  \-/
   4
----------------------
4 + 1
---------------
4 1
\+/
 5
---------------
Result: 5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages