Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / arbore-binar-total-echilibrat.c
Last active November 16, 2026 09:17
Arbore Binar Total Echilibrat
/*
1
/ \
2 4
/ /
3 5
1
/ \
@thinkphp
thinkphp / search.c
Created November 16, 2026 08:43
Cautare Key in Arbore Binar
#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
int id;
struct node_type *left,
*right;
} NodeT;
@thinkphp
thinkphp / inaltime-arbore-binar.c
Created November 16, 2026 08:26
inaltime-arbore-binar
#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
int id;
struct node_type *left,
*right;
} NodeT;
@thinkphp
thinkphp / internal_nodes.c
Created November 16, 2026 08:14
Afisare nodurile interne in Arbore Binar
#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
int id;
struct node_type *left,
*right;
} NodeT;
@thinkphp
thinkphp / node_leaf.c
Created November 16, 2026 08:01
Afiseaza numarul de fruze si frunzele
#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
int id;
struct node_type *left,
*right;
} NodeT;
@thinkphp
thinkphp / deque.c
Created November 16, 2026 07:39
Double Ended Queue Complexitate O(1)
#include <stdio.h>
#include <stdlib.h>
/*
Deque Data Structure
push_front muta front cu o pozitie inapoi acolo
push_back scrie la pozitia (front + size) % cap , apoi creste size
pop_front citste v[front] , avanteaza front = (front + 1) % cap, scade size
pop_back citeste ultimul element de la (front + size - 1) % cap, si scade size,nu muta front
@thinkphp
thinkphp / calculator.cpp
Created November 11, 2026 12:37
prima etapa,. calculator
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <sstream>
#include <stdexcept>
using namespace std;
/*
@thinkphp
thinkphp / arborebinar.creare.c
Created November 9, 2026 09:51
arborebinar.creare
#include <stdio.h>
#include <stdlib.h>
typedef struct node_type {
int id;
struct node_type *left,
*right;
@thinkphp
thinkphp / hashtable.c
Created November 9, 2026 09:18
hashtable.c
#include <stdio.h>
#include <string.h>
#define SIZE 16
typedef struct {
char key[32];
int value;
int used; /*1 - ocupat, 2 - liber*/
@thinkphp
thinkphp / inheritance.java
Created November 9, 2026 08:48
inheritance in java
//clasa de baza
class Animal {
String nume;
Animal(String nume) {
this.nume = nume;
}
void mananca() {