Driver code
int main ( ) { Node * root = new Node ( 1 ) ; root -> left = new Node ( 3 ) ; root -> left -> left = new Node ( 2 ) ; root -> left -> right = new Node ( 1 ) ; root -> left -> right -> left = new Node ( 1 ) ; root -> right = new Node ( -1 ) ; root -> right -> left = new Node ( 4 ) ; root -> right -> left -> left = new Node ( 1 ) ; root -> right -> left -> right = new Node ( 2 ) ; root -> right -> right = new Node ( 5 ) ; root -> right -> right -> right = new Node ( 2 ) ; int k = 5 ; printKPath ( root , k ) ; return 0 ; }