Why RuntimeError?


  • 0
    M
    int* preorderTraversal(struct TreeNode* root, int* returnSize) {
    	static int buff[1000];
    	if(root==NULL){
    		return NULL;
    	}
    	buff[*returnSize]=root->val;
    	(*returnSize)++;
    	preorderTraversal(root->left,returnSize);
    	preorderTraversal(root->right,returnSize);
    	return buff;
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.