prog.cpp:14:9: error: ‘set’ does not name a type
set<int> se;
^~~
prog.cpp:15:18: error: ‘TreeNode’ has not been declared
void DFS(TreeNode* node){
^~~~~~~~
prog.cpp:21:25: error: ‘TreeNode’ has not been declared
int kthSmallest(TreeNode* root, int k) {
^~~~~~~~
prog.cpp: In member function ‘void Solution::DFS(int*)’:
prog.cpp:17:13: error: ‘se’ was not declared in this scope
se.insert(node->val);
^~
prog.cpp:17:29: error: request for member ‘val’ in ‘* node’, which is of non-class type ‘int’
se.insert(node->val);
^~~
prog.cpp:18:23: error: request for member ‘left’ in ‘* node’, which is of non-class type ‘int’
DFS(node->left); // Only follows leftmost path!
^~~~
prog.cpp: In member function ‘int Solution::kthSmallest(int*, int)’:
prog.cpp:24:21: error: ‘se’ was not declared in this scope
return *se.begin()+k; // Wrong! Adds k to first element
^~