Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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;
};
@muhammedeminoglu
muhammedeminoglu / priorityQueue.c
Last active January 2, 2022 11:50
Priority Queue implementation. I used singly Linked list here.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
struct node{
char name[20];
char secondName[20];
int age;
int priority;
struct node *next;
@muhammedeminoglu
muhammedeminoglu / bubbleSort.c
Last active December 2, 2022 17:20
this code generates 10000 random numbers and sorts them with Bubble Sort Algorithm. I used an Array Here. This code could be optimized for if array has already sorted. But my point is just show simple algorithm
#include <stdio.h>
#define SIZE 10000
int myArray[SIZE - 1];
void bubbleSort(int x[])
{
int i, j;
for(i = 1; i < SIZE; i++)
@muhammedeminoglu
muhammedeminoglu / bubbleLinked.c
Created May 20, 2017 23:27
This code shows you how to use linked list on bubble sort.
#include <stdio.h>
#include <stdlib.h>
struct node{
int data;
struct node *next;
};
struct node* start = NULL;
@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 / selectionLinked.c
Created May 26, 2017 19:16
Selection Sort on Linked Lists
#include <stdio.h>
#include <stdlib.h>
struct node{
int data;
struct node *next;
};
struct node* start = NULL;