CVS有卖prenatal vitamin吗# PennySaver - 省钱一族
f*a
1 楼
1. 2D matrix, sorted on each row, first element of next row is larger(or
equal) to the last element of previous row, now giving a target number,
returning the position that the target locates within the matrix
2. Given a binary tree where all the right nodes are leaf nodes, flip it
upside down
* and turn it into a tree with left leaf nodes.
*
* for example, turn these:
*
* 1 1
* / /
* 2 3 2 3
* /
* 4 5
* /
* 6 7
*
* into these:
*
* 1 1
* / /
* 2---3 2---3
* /
* 4---5
* /
* 6---7
*
* where 6 is the new root node for the left tree, and 2 for the right tree.
* oriented correctly:
*
* 6 2
* / /
* 7 4 3 1
* /
* 5 2
* /
* 3 1
*/
equal) to the last element of previous row, now giving a target number,
returning the position that the target locates within the matrix
2. Given a binary tree where all the right nodes are leaf nodes, flip it
upside down
* and turn it into a tree with left leaf nodes.
*
* for example, turn these:
*
* 1 1
* / /
* 2 3 2 3
* /
* 4 5
* /
* 6 7
*
* into these:
*
* 1 1
* / /
* 2---3 2---3
* /
* 4---5
* /
* 6---7
*
* where 6 is the new root node for the left tree, and 2 for the right tree.
* oriented correctly:
*
* 6 2
* / /
* 7 4 3 1
* /
* 5 2
* /
* 3 1
*/