This file contains hidden or 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
#include <stdio.h> | |
int SelectionSort(int array[], int size){ | |
for (int i =0 ; i < size ; i++){ | |
int small = array[i], index = i; | |
for (int j = i ; j<size ; j++){ | |
if (array[j] < small){ | |
small = array[j]; | |
index = j; | |
} |
This file contains hidden or 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
#include <stdio.h> | |
int swap(int* i, int* j){ | |
int temp = *i; | |
*i = *j; | |
*j = temp; | |
} | |
int SelectionSort(int array[], int size){ | |
for (int i =0 ; i < size ; i++){ |
This file contains hidden or 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
#include <stdio.h> | |
int swap(int* i, int* j){ | |
int temp = *i; | |
*i = *j; | |
*j = temp; | |
} | |
int BubbleSort(int array[], int size){ | |
for (int i =0 ; i < size-1 ; i++){ |
This file contains hidden or 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
#include <stdio.h> | |
int swap(int* i, int* j){ | |
int temp = *i; | |
*i = *j; | |
*j = temp; | |
} | |
int InsertionSort(int array[], int size){ | |
for (int i =1 ; i < size ; i++){ |
This file contains hidden or 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
# include<stdio.h> | |
# define CAPACITY 5 | |
int stack[CAPACITY], top = -1 ; | |
//Prototyping | |
void push(int); | |
int isFull(void); | |
void pop(void); | |
int isEmpty(void); | |
void peek(void); |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
//Prototyping | |
void append(void); | |
void add_begin(void); | |
void add_after(void); | |
void delete_node(void); | |
void display(void); | |
int length(void); |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
# define CAPACITY 5 | |
int queue[CAPACITY], top = -1, base = -1; | |
//prototyping | |
void enQueue(int); | |
int isEmpty(void); | |
int isFull(void); |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
//Prototyping | |
void append(void); | |
void add_begin(void); | |
void add_after(void); | |
void delete_node(void); | |
void display(void); | |
void reverse(void); |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
//prottyping | |
void push(int); | |
int pop(void); | |
void traverse(void); | |
int length(void); | |
void delete(void); | |
//initialize |
This file contains hidden or 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
#include<stdio.h> | |
#include<stdlib.h> | |
// Initialization ---------------------------------------------------------------------------------- | |
struct node { | |
int data; | |
struct node* left; | |
struct node* right; | |
}; |