Anonymous user
Same fringe: Difference between revisions
Updated both D entries
(Updated both D entries) |
|||
Line 451:
T[] scan(Node!T* t) {
if (!t) return [];
}
return scan(t1) == scan(t2);
Line 460 ⟶ 458:
void main() {
auto t1 = new
auto t2 = new
▲ auto t3 = n(1, n(2, n(3, n(40), n(51))));
writeln(sameFringe(t1, t2));
writeln(sameFringe(t1, t3));
Line 513 ⟶ 506:
T data;
BinaryTreeNode* left, right;
}
Line 660 ⟶ 646:
void main() {
import std.stdio;
alias N = BinaryTreeNode!int
static N* n(in int x, N* l=null, N* r=null) pure nothrow {
|