-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b64c5a1
commit 1b98e2f
Showing
148 changed files
with
2,593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Mac", | ||
"includePath": [ | ||
"/usr/include", | ||
"/usr/local/include", | ||
"${workspaceRoot}" | ||
], | ||
"defines": [], | ||
"intelliSenseMode": "clang-x64", | ||
"browse": { | ||
"path": [ | ||
"/usr/include", | ||
"/usr/local/include", | ||
"${workspaceRoot}" | ||
], | ||
"limitSymbolsToIncludedHeaders": true, | ||
"databaseFilename": "" | ||
}, | ||
"macFrameworkPath": [ | ||
"/System/Library/Frameworks", | ||
"/Library/Frameworks" | ||
] | ||
}, | ||
{ | ||
"name": "Linux", | ||
"includePath": [ | ||
"/usr/include", | ||
"/usr/local/include", | ||
"${workspaceRoot}" | ||
], | ||
"defines": [], | ||
"intelliSenseMode": "clang-x64", | ||
"browse": { | ||
"path": [ | ||
"/usr/include", | ||
"/usr/local/include", | ||
"${workspaceRoot}" | ||
], | ||
"limitSymbolsToIncludedHeaders": true, | ||
"databaseFilename": "" | ||
} | ||
}, | ||
{ | ||
"name": "Win32", | ||
"includePath": [ | ||
"${workspaceRoot}" | ||
], | ||
"defines": [ | ||
"_DEBUG", | ||
"UNICODE" | ||
], | ||
"intelliSenseMode": "msvc-x64", | ||
"browse": { | ||
"path": [ | ||
"${workspaceFolder}", | ||
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++" | ||
], | ||
"limitSymbolsToIncludedHeaders": true, | ||
"databaseFilename": "" | ||
} | ||
} | ||
], | ||
"version": 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_project_file> | ||
<FileVersion major="1" minor="6" /> | ||
<Project> | ||
<Option title="C programs" /> | ||
<Option pch_mode="2" /> | ||
<Option compiler="gcc" /> | ||
<Build> | ||
<Target title="Debug"> | ||
<Option output="bin/Debug/C programs" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Debug/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-g" /> | ||
</Compiler> | ||
</Target> | ||
<Target title="Release"> | ||
<Option output="bin/Release/C programs" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Release/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-O2" /> | ||
</Compiler> | ||
<Linker> | ||
<Add option="-s" /> | ||
</Linker> | ||
</Target> | ||
</Build> | ||
<Compiler> | ||
<Add option="-Wall" /> | ||
</Compiler> | ||
<Unit filename="main.c"> | ||
<Option compilerVar="CC" /> | ||
</Unit> | ||
<Extensions> | ||
<code_completion /> | ||
<envvars /> | ||
<debugger /> | ||
<lib_finder disable_auto="1" /> | ||
</Extensions> | ||
</Project> | ||
</CodeBlocks_project_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_layout_file> | ||
<FileVersion major="1" minor="0" /> | ||
<ActiveTarget name="Debug" /> | ||
<File name="main.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||
<Cursor> | ||
<Cursor1 position="107" topLine="0" /> | ||
</Cursor> | ||
</File> | ||
</CodeBlocks_layout_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_project_file> | ||
<FileVersion major="1" minor="6" /> | ||
<Project> | ||
<Option title="C programs" /> | ||
<Option pch_mode="2" /> | ||
<Option compiler="gcc" /> | ||
<Build> | ||
<Target title="Debug"> | ||
<Option output="bin/Debug/C programs" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Debug/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-g" /> | ||
</Compiler> | ||
</Target> | ||
<Target title="Release"> | ||
<Option output="bin/Release/C programs" prefix_auto="1" extension_auto="1" /> | ||
<Option object_output="obj/Release/" /> | ||
<Option type="1" /> | ||
<Option compiler="gcc" /> | ||
<Compiler> | ||
<Add option="-O2" /> | ||
</Compiler> | ||
<Linker> | ||
<Add option="-s" /> | ||
</Linker> | ||
</Target> | ||
</Build> | ||
<Compiler> | ||
<Add option="-Wall" /> | ||
</Compiler> | ||
<Unit filename="main.c"> | ||
<Option compilerVar="CC" /> | ||
</Unit> | ||
<Unit filename="new.c"> | ||
<Option compilerVar="CC" /> | ||
<Option target="<{~None~}>" /> | ||
</Unit> | ||
<Extensions> | ||
<code_completion /> | ||
<envvars /> | ||
<debugger /> | ||
<lib_finder disable_auto="1" /> | ||
</Extensions> | ||
</Project> | ||
</CodeBlocks_project_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# depslib dependency file v1.0 | ||
1446667744 source:d:\programs\c\c programs\c programs\main.c | ||
<stdio.h> | ||
<stdlib.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | ||
<CodeBlocks_layout_file> | ||
<FileVersion major="1" minor="0" /> | ||
<ActiveTarget name="Debug" /> | ||
<File name="main.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> | ||
<Cursor> | ||
<Cursor1 position="20" topLine="0" /> | ||
</Cursor> | ||
</File> | ||
</CodeBlocks_layout_file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() | ||
{ | ||
printf("Hello world!\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() | ||
{ | ||
printf("Hello world!\n"); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
typedef struct node ///////////iterative method | ||
{ | ||
struct node *left,*right; | ||
int data; | ||
}node; | ||
|
||
int height(node *root) | ||
{ | ||
node *temp=root; | ||
|
||
int left_height=0; | ||
int right_height=0; | ||
if(root==NULL) | ||
{ | ||
return(0); | ||
} | ||
left_height=height(temp->left); | ||
|
||
right_height=height(temp->right); | ||
|
||
if(left_height>right_height) | ||
{ | ||
return(left_height+1); | ||
|
||
} | ||
else {return(right_height+1);} | ||
} | ||
|
||
int bst_enter(node *root,int x) | ||
{ | ||
node *temp=(node *)malloc(sizeof(node)); | ||
temp->data=x; | ||
temp->left=NULL; | ||
temp->right=NULL; | ||
|
||
if(root==NULL) | ||
{ | ||
root=temp; | ||
} | ||
else if(x<root->data) | ||
{ | ||
root->left=bst_enter(root->left,x); | ||
} | ||
else | ||
{ | ||
root->right=bst_enter(root->right,x); | ||
} | ||
return(root); | ||
} | ||
|
||
int main() | ||
{ | ||
node *root=NULL; | ||
root=bst_enter(root,15); | ||
root=bst_enter(root,30); | ||
root=bst_enter(root,25); | ||
root=bst_enter(root,20); | ||
root=bst_enter(root,10); | ||
root=bst_enter(root,4); | ||
|
||
|
||
|
||
int x=height(root); | ||
printf("%d",x); | ||
} | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
typedef struct node ///////////iterative method | ||
{ | ||
struct node *left,*right; | ||
int data; | ||
}node; | ||
|
||
int find_min(node *root) | ||
{ | ||
node *current=root; | ||
if(root==NULL) | ||
{ | ||
return(0); | ||
} | ||
else if(current->left==NULL) | ||
{ | ||
return(current->data); | ||
} | ||
|
||
return(find_min(current->left)); | ||
} | ||
|
||
int bst_enter(node *root,int x) | ||
{ | ||
node *temp=(node *)malloc(sizeof(node)); | ||
temp->data=x; | ||
temp->left=NULL; | ||
temp->right=NULL; | ||
|
||
if(root==NULL) | ||
{ | ||
root=temp; | ||
} | ||
else if(x<root->data) | ||
{ | ||
root->left=bst_enter(root->left,x); | ||
} | ||
else | ||
{ | ||
root->right=bst_enter(root->right,x); | ||
} | ||
return(root); | ||
} | ||
|
||
int main() | ||
{ | ||
node *root=NULL; | ||
root=bst_enter(root,15); | ||
root=bst_enter(root,5); | ||
root=bst_enter(root,10); | ||
|
||
int x=find_min(root); | ||
printf("%d",x); | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
typedef struct node ///////////iterative method | ||
{ | ||
struct node *left,*right; | ||
int data; | ||
}node; | ||
|
||
int find_min(node *root) | ||
{ | ||
node *current=root; | ||
if(root==NULL) | ||
{ | ||
return(0); | ||
} | ||
while(current->left!=NULL) | ||
{ | ||
current=current->left; | ||
} | ||
return(current->data); | ||
|
||
} | ||
|
||
int bst_enter(node *root,int x) | ||
{ | ||
node *temp=(node *)malloc(sizeof(node)); | ||
temp->data=x; | ||
temp->left=NULL; | ||
temp->right=NULL; | ||
|
||
if(root==NULL) | ||
{ | ||
root=temp; | ||
} | ||
else if(x<root->data) | ||
{ | ||
root->left=bst_enter(root->left,x); | ||
} | ||
else | ||
{ | ||
root->right=bst_enter(root->right,x); | ||
} | ||
return(root); | ||
} | ||
|
||
int main() | ||
{ | ||
node *root=NULL; | ||
root=bst_enter(root,15); | ||
root=bst_enter(root,5); | ||
root=bst_enter(root,10); | ||
|
||
int x=find_min(root); | ||
printf("%d",x); | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.