TADM2E 5.10

From Algorithm Wiki
Revision as of 16:13, 29 June 2020 by Bkarpov96 (talk | contribs) (Solution of 5.10)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Pre-ordered DFS: process left, process right, process current

If current node is number:
	return number

If current node is calculation:
	do calulation on DFS(left_child) and DFS(right_child)
	save result in current node
	forget edges to children
	return number

Modification from 5.9 - reduction of nodes.
--Bkarpov96 (talk) 16:13, 29 June 2020 (UTC)