Difference between revisions of "TADM2E 5.10"

From Algorithm Wiki
Jump to: navigation, search
(Blanked the page)
(Undo revision 861 by Bkarpov96Wars (talk))
 
Line 1: Line 1:
 +
Pre-ordered DFS: process left, process right, process current
 +
<pre>
 +
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
 +
</pre>
 +
Modification from 5.9 - reduction of nodes.<br>
 +
--[[User:Bkarpov96|Bkarpov96]] ([[User talk:Bkarpov96|talk]]) 16:13, 29 June 2020 (UTC)

Latest revision as of 11:21, 22 July 2020

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)