News for hackers. Stuff that matters.

tjscanlon

Re:Invert a binary tree on LeetCode on Saturday June 13, 2015 @06:36AM (#9710570)
Iterative solution:

    def invertTree(self, root):
        queue = []
        if root is not None:
            queue.append(root)
        while queue:
            current = queue.pop()
            current.left, current.right = current.right, current.left
            if current.left is not None:
                queue.append(current.left)
            if current.right is not None:
                queue.append(current.right)
        return root
Re:Implementing a Virtual Machine in C on Sunday May 10, 2015 @05:00AM (#9519367)
For everyone who enjoyed this or wants to take it a step further, I recommend writing a CHIP-8 emulator. I used the following source: http://www.multigesture.net/articles/how-to-write-an-emulato... and it was very helpful.
Re:I fired half my team on Tuesday March 17, 2015 @01:23AM (#9216409)
Bravo to the CEO for handling it this way. It really shows how treating others like humans and remaining compassionate no matter what the situation is beneficial to everyone.