Binary Tree Level Order Traversal II

collection.reverse() time complexity is O(n)

the old method use add(int index , E element) method in ArrayList to insert the deeper level Elements in the front of result. this method performance is worse than using the reverse() method

results matching ""

    No results matching ""