Skip to content

Instantly share code, notes, and snippets.

View gozeloglu's full-sized avatar
🎯
Focusing

Gökhan Özeloğlu gozeloglu

🎯
Focusing
View GitHub Profile
@gozeloglu
gozeloglu / tables.sql
Last active June 2, 2020 12:29
NEW TABLES
CREATE TABLE `book` (
`ISBN` int(11) NOT NULL AUTO_INCREMENT,
`BookName` varchar(45) NOT NULL,
`Author` varchar(45) NOT NULL,
`Description` varchar(1024) DEFAULT 'Null',
`Category` varchar(45) NOT NULL,
`SubCategory` varchar(45) DEFAULT NULL,
`InHotlist` tinyint(1) DEFAULT 0,
`BookImage` varchar(256) NOT NULL,
`ReleasedTime` timestamp(6) NULL DEFAULT current_timestamp(6),
@gozeloglu
gozeloglu / airports.txt
Created May 27, 2019 22:01
Sorted Countries
Isle of Man 1
Faroe Islands 1
Bermuda 1
Tuvalu 1
Brunei 1
Gaza Strip 1
Gibraltar 1
Niue 1
Nauru 1
Macau 1
import random as rd
""" This is the simplest searching algorithm.
All elements checked in data one by one.
If value is found in array, its index is returned.
If not found, function returns -1.
Complexity of this algorithm is O(n)
In the best case scenerio, value can be found in first
index.
In the worst case scenirio, value is found in last index"""
@gozeloglu
gozeloglu / insertionSort.py
Last active March 10, 2019 12:16
This is an insertion sort algorithm implemented in Python.
import random as rd
''' Complexity : O(n^2)
In the worst case, the function looks and inverse the elements
(n * (n-1))/2 times. (Reverse order situation)
~1/2N^2 compares and ~1/2N^2 exchanges.
In the best case, the array is sorted. So, we do not make any
inversion operation. We just iterates the array n times and
makes N-1 compares. So, our complexity is O(n).
On average case, insertion sort uses ~1/4N^2 compares and
@gozeloglu
gozeloglu / selectionSort.py
Last active March 6, 2019 18:09
This is an selection sort algorithm implemented in Python
import random as rd
''' Complexity : O(n^2)
It looks at each elements and makes comparision
like (n-1), (n-2), ..., 1
So, if we sum up all comparisions, the result will be (n * (n-1)) / 2
Because of the summation, the complexity will be O(n^2)'''
def selectionSort(arr):
@gozeloglu
gozeloglu / stack.c
Created October 13, 2018 21:05 — forked from ArnonEilat/stack.c
Very simple stack implementation in C with usage example.
#include <stdio.h>
#include <stdlib.h>
#define FALSE 0
#define TRUE 1
typedef struct {
int info;
} DATA;
@gozeloglu
gozeloglu / reverse_array.c
Last active October 10, 2018 20:58
Reverse operation is being implemented in C language with using function and pointers.
/*
* author: Gökhan Özeloğlu
*
* date: 10.10.2018
*
* code: reverse operation in C language
*
* email: gozeloglu@gmail.com
*/