| 29 | return node; |
| 30 | } |
| 31 | void saveNode(struct node *root, vector<struct node *> &nodes) |
| 32 | { |
| 33 | if (root == NULL) |
| 34 | return; |
| 35 | |
| 36 | saveNode(root->left, nodes); |
| 37 | nodes.push_back(root); |
| 38 | saveNode(root->right, nodes); |
| 39 | } |
| 40 | |
| 41 | int findKthMin(struct node *root, int k) |
| 42 | { |