Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 967 Bytes

README.md

File metadata and controls

51 lines (42 loc) · 967 Bytes

##Running Project use gradle wrapper to build. File /src/test/java/pl/astrait/invertbinarytree/TreeTest.java contains junit test. You can run test using:

gradlew test

Invert a Binary Tree

Invert a binary tree.

     1
   /   \
  2     3
 / \   / \
4   5 6   7

to

     1
   /   \
  3     2
 / \   / \
7   6 5   4

Data structures:

Scala:

case class TreeNode(value: Int, left: Option[TreeNode], right: Option[TreeNode])

Java:

public class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;
    TreeNode(int x) { val = x; }
}

You can check contest bye-laws here.

Check out our Confitura 2015 site here

We are hiring! Visit our career site.