Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mostRetweeted: Tweet = {
- if (left.isEmpty && right.isEmpty)
- elem
- else if (left.isEmpty)
- maxRetweeted(right.mostRetweeted, elem)
- else if (right.isEmpty)
- maxRetweeted(left.mostRetweeted, elem)
- else maxRetweeted(right.mostRetweeted, maxRetweeted(elem, left.mostRetweeted))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement