This file contains 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
// Ağaçta tutulacak herbir elemanı tanımlayan sınıf | |
class Node { | |
int key; // elemanın değeri | |
Node leftChild, rightChild; // sol ve sağ elemanların erişim bilgileri | |
// yapıcı işlev, parametre değerlerinin ilgili öz niteliklere atar | |
Node(int key, Node leftChild, Node rightChild) { ... } | |
} | |
// Ağaç veri yapısını, "ikili arama ağacı" olarak tanımlayan sınıf |
This file contains 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
// search işlevi, key değerine sahip elemanı bulup erişim bilgisini verir | |
public Node search(int key) { | |
return search(key,root); // öz yinelemeli iç işlevi çağır | |
} | |
// parametrede verilen key değerine sahip elemanı, kökü t olan ağacın veya alt ağacın altında arar | |
// öz yinelemeli iç işlev, öz nitelik erişimi olmadığı için "static" | |
private static Node search(int key, Node t) { | |
if(t==null) // kök yoksa (bu alt ağaç boşsa), | |
return null; // bulamadık |
This file contains 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
def dec2fib(n): #Ozyineli fibonacci mantigiyla fibonacci dizisini buldurur. | |
if n==0: | |
return 0 | |
elif n==1: | |
return 1 | |
else: | |
return (dec2fib(n-1) + dec2fib(n-2)) | |
def indis_parcala(a): #Fibonacci dizisinde yerine '1' koyulmasi gereken indisleri dondurur. | |
i=1 | |
while a > i: |
This file contains 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
import java.util.Scanner; | |
public class kullanıcıkup | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner s=new Scanner(System.in); | |
System.out.println("Lütfen bir sayı giriniz."); | |
int a=s.nextInt(); | |
hesapla(a); |
This file contains 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
public class kup | |
{ | |
public static void main(String[] args) | |
{ | |
hesapla(5); | |
} | |
static void hesapla(int a) | |
{ | |
System.out.println(a*a*a); | |
} |
This file contains 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
public class parametresiz | |
{ | |
public static void main(String[] args){ | |
yaz(); | |
} | |
static void yaz() | |
{ | |
System.out.println("Bu method cagrildi."); |
This file contains 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 main(void) { | |
int ay,gun; | |
printf("Lütfen bir tarih giriniz.(gün/ay) : "); | |
scanf("%d/%d",&gun,&ay); | |
switch (ay) { | |
case 12: | |
ay=365-(31-gun); |
This file contains 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
/*copyright ftastemur */ | |
#include <stdio.h> | |
int main(void) | |
{ | |
int sayi,flag=0, i; | |
printf("Bir sayi giriniz: "); |
This file contains 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> | |
#include <string.h> | |
static int | |
cmpstringp(const void *p1, const void *p2) | |
{ | |
/* The actual arguments to this function are "pointers to | |
pointers to char", but strcmp(3) arguments are "pointers | |
to char", hence the following cast plus dereference */ |
This file contains 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 ROT 13 | |
int main(void) | |
{ | |
int c, c_yeni; | |
while((c = getchar()) != EOF){ | |
if(c >= 'A' && c <= 'Z'){ | |
if((c_yeni = c + ROT) <= 'Z') |
NewerOlder