Skip to content

Instantly share code, notes, and snippets.

@muhammedeminoglu
muhammedeminoglu / dfs.c
Created June 4, 2017 10:48
DFS C Code implementation. This code has been written recursive method. Don't forget matris.txt file. You can change it as you want.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int Array[6][6];
bool visited[6];
void DFS(int root, bool visited[])
{
int i;
@muhammedeminoglu
muhammedeminoglu / bfs.c
Last active May 25, 2020 16:47
BFS Algorithm C Code with Queue implementation. You have to have "matris.txt" file for nodes. Don't miss it.
#include <stdio.h>
#include <stdbool.h>
int graph[6][6];
bool visited[5];
struct node{
int data;
struct node *next;
};
@muhammedeminoglu
muhammedeminoglu / insertionSort.c
Created May 26, 2017 19:38
Insertion Sort C Code with an Array
#include <stdio.h>
#define SIZE 10000
int myArray[SIZE - 1];
void insertionSort(int x[])
{
int i, j;
int key;
@muhammedeminoglu
muhammedeminoglu / selectionSort.c
Created May 26, 2017 19:01
Selection Sort C Code. I think it is clean and understandable...
#include <stdio.h>
#define SIZE 10000
int myArray[SIZE - 1];
void selectionSort(int x[])
{
int i, j;
int key;
@muhammedeminoglu
muhammedeminoglu / queueArray.c
Created May 20, 2017 18:27
enqueue and dequeue operations with array
#include <stdio.h>
#define QUEUESIZE 5
int Queue[QUEUESIZE - 1];
int frontElement = -1, rearElement = -1;
void enQueue(int item)
{
if(rearElement > 4)
@muhammedeminoglu
muhammedeminoglu / stackLinked.c
Created May 20, 2017 18:25
All the Stack Operations with Linked List
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
struct person{
char firstName[19];
char secondName[19];
int age;
struct person *next;
@muhammedeminoglu
muhammedeminoglu / stackArray.c
Created May 20, 2017 18:24
Stack operations, Push, pop, peek with array
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define STACKLIMIT 5
// ************ Muhammed Eminoglu ************
// *********www.algoritmauzmani.com***********
// *********www.muhammedeminoglu.com**********
@muhammedeminoglu
muhammedeminoglu / singlyList.c
Created May 20, 2017 18:23
Singly Linked List All Operation
#include <stdio.h>
#include <stdlib.h>
////// ****** AUTHOR Muhammed Eminoðlu ****** \\\\\
//////*****************************************\\\\\
//////******************************************\\\\\
//////**********www.muhammedeminoglu.com*********\\\\\
//////**********www.algoritmauzmani.com***********\\\\\
//Global variables
@muhammedeminoglu
muhammedeminoglu / prims.c
Last active November 30, 2021 18:32
Prims Algorithm C Code Implemantation. Dont Forget to create matris.txt file
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define MELKOR 1000000
/*
Create matris.txt file in your project folder and copy below content.
0 2 0 6 0
2 0 3 8 5
0 3 0 0 7
@muhammedeminoglu
muhammedeminoglu / queueLinked.c
Created May 20, 2017 19:12
Queue implementatih on with Linked Lists
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
struct node{
char name[20];
char secondName[20];
int age;
struct node *next;
};