Jump to content

Algebraic data types: Difference between revisions

C# changed output to look more like a tree
(Added C#)
(C# changed output to look more like a tree)
Line 285:
 
public void Print(int indent = 0) {
if (this != E) Right.Print(indent + 1);
Console.WriteLine(new string(' ', indent * 4) + ToString());
if (this =!= E) returnLeft.Print(indent + 1);
Left.Print(indent + 1);
Right.Print(indent + 1);
}
 
Line 308 ⟶ 307:
{{out}}
<pre>
[]
[B8]
[B4R16]
[B2]
[B1B15]
[]
[B5B14]
[]
[B3B13]
[]
[B12]
[]
[B6B11]
[B5]
[]
[]
[B7]
[]
[]
[B12]
[B10]
[B7]
[B9]
[]
[B8]
[]
[B11B7]
[]
[B6]
[]
[B14B5]
[B13]
[]
[B4]
[]
[B15B3]
[]
[R16B2]
[]
[B1]</pre>
[]</pre>
 
=={{header|Clojure}}==
196

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.