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 / nextPermutation.java
Created May 10, 2026 12:33
Next Permutation LeetCode
/*
n = 3
n! = n(n-1)!
3! = 6 permutari
1 2 3
1 3 2
2 1 3
@thinkphp
thinkphp / coliniare.java
Last active May 10, 2026 11:46
Puncte coliniare. problema
/*
P1 , P2, P3
Panta P1P2 == Panta P2P3 sunt coliniare
m = y2 - y1 / x2 - x1
Panta a doua puncte iti spune cat de inclinata este dreapta care trece prin ele, adica cat de mult creste sau scade valoarea lui y atunci cand x creste
@thinkphp
thinkphp / singly-linked-list.cpp
Created May 9, 2026 09:15
lista simplu inlantuita Data Structure
/*
Singly Linked List (Lista Simplu Inlantuita) (Grafuri-reprezentare prin liste de adiacenta)
--------------------------------------------
Doubly Linked List
Circular Linked List
node1(info, next) ---> node2(info, next)---> node3(info, next)---> ....->nodeN(info, NULL)
@thinkphp
thinkphp / colineare.cpp
Created May 9, 2026 07:02
Determinare puncte colinearea
//Problema:
//Se citesc de la tastatura coordonatele a 3 puncte diferite in plan. Decideti daca aceste puncte sunt colineare.
//punct1(x,y)
//punct2(x,y)
//punct3(x,y)
// panta dreptei determinate de segmentul P1P2 = panta dreptei terminate de segmentul P2P3,
@thinkphp
thinkphp / cartedevizitaclass.cpp
Last active May 3, 2026 10:12
Carte de vizita Proiect
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
// ===============================================
// clasa de baza: carte de vizita
//================================================
class CarteDeVizita {
@thinkphp
thinkphp / exemplu_static.cpp
Created May 3, 2026 09:08
Exemplu utilizare static
#include <iostream>
using namespace std;
class Contor {
private:
static int numarObiecte;
public:
@thinkphp
thinkphp / traseu.cpp
Created May 3, 2026 08:43
Proiect Traseu
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
//CLASA PUNCT
class Punct {
@thinkphp
thinkphp / edit_distance_reconstruct.cpp
Created May 2, 2026 08:27
Edit Distance with reconstruction
/*
ioana ---> danaia
EDIT DISTANCE
-------------
cuvant1 --->cuvant2
source ---> destinatie
@thinkphp
thinkphp / closest-pair-points.cpp
Created May 2, 2026 07:04
Cele mai apropiate puncte din plan Complexitate patratica
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
struct Point {
double x, y;
};
@thinkphp
thinkphp / fork.c
Created May 2, 2026 06:40
fork() process IF
#include <iostream>
#include<unistd.h>
using namespace std;
int main(int argc, char const *argv[])
{
if( fork() ) {