Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@mertyildiran
mertyildiran / gauss.c
Created December 20, 2013 13:12
// nxn'lik bir matrise Gauss Elimination uygulayan program
// nxn'lik bir matrise Gauss Elimination uygulayan program
// Mehmet Mert Yıldıran 12060367
// Ubuntu terminal altında çalıştırma:
// gcc gauss.c -o gauss
// ./gauss
#include<stdio.h>
#define MAX 10
int lcm(int x,int y);
@mertyildiran
mertyildiran / cramer.c
Created December 20, 2013 13:36
nxn'lik bir matrise Cramer uygulayan program
// nxn'lik bir matrise Cramer uygulayan program
// Mehmet Mert Yıldıran 12060367
// Ubuntu terminal altında çalıştırma:
// gcc cramer.c -o cramer
// ./cramer
#include<stdio.h>
void readmatrix(int m[][8], int s){
int i,j;
printf("Matrisin elemanlarını sırasıyla Enter'a basarak giriniz: \n");
@mertyildiran
mertyildiran / quickfind.rb
Last active January 1, 2016 01:39
QuickFind programı
# QuickFind programı
# Mehmet Mert Yildiran 12060367
# Ubuntu üzerinde çalıştırmak için:
# ruby quickfind.rb
class QuickFind
def initialize(n)
@ids = []
0.upto(n-1) {|i| @ids[i] = i}
end
@mertyildiran
mertyildiran / sayitoplam.rb
Created December 22, 2013 13:19
String içerisindeki sayıları toplama
girdi = "on3d1oku5zm7ayis3"
sayilar = "0123456789"
toplam = 0
i=0
while i < girdi.length
j=0
while j < sayilar.length
if girdi[i] == sayilar[j]
toplam += girdi[i].to_i
@mertyildiran
mertyildiran / arrayeachtotal.rb
Created December 22, 2013 21:40
Dizi elemanları toplama
girdi=[1,[2,3],4,[5],[6,7]]
b=[]
i=0
while i < girdi.length
if girdi[i].kind_of?(Array)
if !girdi[i][0].nil?
b << girdi[i][0]
end
if !girdi[i][1].nil?
b << girdi[i][1]
@mertyildiran
mertyildiran / polidrom.rb
Created December 22, 2013 21:52
Polidrom RUBY
a="merve"
b="evrem"
i=0
y=b.length - 1
saydir=0
if a.length == b.length
while i < a.length
if a[i]==b[y]
saydir += 1
@mertyildiran
mertyildiran / answer1.rb
Created March 17, 2014 13:05
Nesne Yonelimli Programlama Odev 1
#encoding: UTF-8
class Merhaba
def self.class_method
puts "Merhaba, ben bir sınıf metoduyum!"
end
def instance_method
puts "Merhaba, ben bir nesne metoduyum!"
end
end
@mertyildiran
mertyildiran / hash.py
Last active August 29, 2015 13:57
Excellent Hash Algorithm :)
import csv
import time
started = time.clock()
hash_list = []
unique_hash_list = []
print "\n>> TABLE: << \n"
with open('liste.csv', 'rb') as csvfile:
@mertyildiran
mertyildiran / BinaryTree.py
Last active August 29, 2015 13:57
Data Structures and Algorithms in Python
def BinaryTree(r):
return [r, [], []]
def insertLeft(root,newBranch):
t = root.pop(1)
if len(t) > 1:
root.insert(1, [newBranch,t,[]])
else:
root.insert(1, [newBranch, [], []])
return root
@mertyildiran
mertyildiran / class.rb
Last active August 29, 2015 13:57
Object Oriented Programming in Ruby
#!/usr/bin/ruby
# encoding: utf-8
class Point
# XXX Her nitelik için okuyucu yazmamız gerekmiyor
attr_reader :x, :y
def initialize(x, y)
@x, @y = x, y
end