有序數組構建平衡二叉樹

#include <stdio.h> TreeNode *sortedArrayToBST(vector<int> &num){ if(num.size()==0) return NULL; if(num.size()==1){ TreeNode*parent =new TreeNode(num[0]); return parent; } int first=0; int
相關文章
相關標籤/搜索