void KthSmallest::DepthSort(TreeNode* root) { if(root->left) DepthSort(root->left); m_sortedList.push_back(root->val); if(root->right) DepthSort(root->right); }
int KthSmallest::FindKthSmallest(TreeNode* root, int k) { DepthSort(root); return m_sortedList.at(k-1); }
void MultiPassProxyGeometry::performDepthSort() { std::sort(sortedInput_.begin(), sortedInput_.end(), DepthSort(camera_.get().getPosition())); }