Date post: | 14-Apr-2017 |
Category: |
Software |
Upload: | berk-soysal |
View: | 1,499 times |
Download: | 1 times |
static void mirrorTree(node root){
if(root == null) return;
node left = root.getLeft();node right = root.getRight();node.setLeft(right);node.setRight(left);mirrorTree(right);mirrorTree(left);}
Q3
Q5
4 1 2Node p
Node q = p.next
list2555 100 999
list1.insertAfter(1, list2);
otherFirst otherLast
p.next = otherFirst;otherFirst.previous = p;otherLast.next = q;q.previous = otherLast;