Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db48016

Browse filesBrowse files
committed
change folder name
1 parent 3899c3b commit db48016
Copy full SHA for db48016

File tree

Expand file treeCollapse file tree

179 files changed

+43
-0
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

179 files changed

+43
-0
lines changed
File renamed without changes.
File renamed without changes.

‎c_solution/1.c renamed to ‎c/1.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c/108的副本.c

Copy file name to clipboard
+43Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include "tree.h"
2+
3+
4+
struct TreeNode* vsortedArrayToBST(int* nums, int start, int end)
5+
{
6+
struct TreeNode* root = malloc(sizeof(struct TreeNode));
7+
root->val = nums[(end-start)/2+start];
8+
9+
if(start == end)
10+
{
11+
root->left = NULL;
12+
root->right = NULL;
13+
}
14+
else if(end - start == 1)
15+
{
16+
root->left = NULL;
17+
root->right = vsortedArrayToBST(nums, start+(end-start)/2+1,end);
18+
}
19+
else
20+
{
21+
root->left = vsortedArrayToBST(nums, start, start+(end-start)/2-1);
22+
root->right = vsortedArrayToBST(nums, start+(end-start)/2+1,end);
23+
}
24+
return root;
25+
}
26+
27+
struct TreeNode* sortedArrayToBST(int* nums, int numsSize)
28+
{
29+
if(!nums || numsSize == 0)
30+
return NULL;
31+
else
32+
return vsortedArrayToBST(nums, 0, numsSize-1);
33+
}
34+
35+
36+
37+
void main()
38+
{
39+
int test[3] = {1,2,3};
40+
struct TreeNode* root = sortedArrayToBST(test, 3);
41+
printf("%d,%d,%d\n", root->val, root->left->val, root->right->val);
42+
43+
}
File renamed without changes.

‎c_solution/11.c renamed to ‎c/11.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/13.c renamed to ‎c/13.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/19.c renamed to ‎c/19.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/2.c renamed to ‎c/2.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/20.c renamed to ‎c/20.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/21.c renamed to ‎c/21.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/23.c renamed to ‎c/23.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/24.c renamed to ‎c/24.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.

‎c_solution/25.c renamed to ‎c/25.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.

‎c_solution/26.c renamed to ‎c/26.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/27.c renamed to ‎c/27.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎c_solution/36.c renamed to ‎c/36.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/48.c renamed to ‎c/48.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.

‎c_solution/58.c renamed to ‎c/58.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/61.c renamed to ‎c/61.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/62.c renamed to ‎c/62.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/66.c renamed to ‎c/66.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/67.c renamed to ‎c/67.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/70.c renamed to ‎c/70.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/74.c renamed to ‎c/74.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/75.c renamed to ‎c/75.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/8.c renamed to ‎c/8.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/82.c renamed to ‎c/82.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/83.c renamed to ‎c/83.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/88.c renamed to ‎c/88.c

Copy file name to clipboard
File renamed without changes.

‎c_solution/9.c renamed to ‎c/9.c

Copy file name to clipboard
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.