Created
July 11, 2016 08:16
-
-
Save george-hawkins/1ecb310d6a4452d5c666fb584087bc29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def union(that: TweetSet): TweetSet = { | |
(left union (right union that)) incl elem | |
// If we have two trees x={{{.a.}b.}c{.d{.e.}}} and y={{{.f.}g.}h{.i{.j.}}} the number of calls to union varies dramatically according to how we order things: | |
// | |
// (left union (right union that)) incl elem // calls=5 | |
// (right union (left union that)) incl elem // calls=5 | |
// (right union (that union left)) incl elem // calls=36 | |
// (left union (that union right)) incl elem // calls=33 | |
// (that union (left union right)) incl elem // calls=26 | |
// (that union (right union left)) incl elem // calls=26 | |
// | |
// left union right union that incl elem // calls=13 | |
// right union left union that incl elem // calls=13 | |
// right union that union left incl elem // calls=56 | |
// left union that union right incl elem // calls=74 | |
// that union left union right incl elem // calls=77 | |
// that union right union left incl elem // calls=90 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment