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