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 / tic-tac-toe.java
Created May 23, 2026 07:37
Tic Tac Toe Cu AI
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Main extends JFrame implements ActionListener {
int choice = 0, choice1 = 0, choice2 = 0;
JFrame f1, f2;
JPanel p1, p2, p3;
@thinkphp
thinkphp / grafuri-citire.java
Created May 17, 2026 15:22
Graf/Citire/DFS
import java.util.*;
public class Graf {
private final int[][] mat;
public final boolean[] vizitat;
private final int n;
@thinkphp
thinkphp / Hamilton.java
Created May 17, 2026 14:57
generare Cicluri Hamiltoniene; graful este memorat prin matricea de adiacenta
/*
Grafuri
-------
Graf <=> orice multime finita V, prevazuta cu o relatie binara interna E
G = (V,E)
V = numarul de noduri
E = numarul de muchii
@thinkphp
thinkphp / edit-distance-CSES.java
Last active May 17, 2026 13:36
edit-distance-CSES.java
import java.io.*;
public class editDistance {
static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ;
BufferedReader s = br.readLine();
BufferedReader d = br.readLine();
@thinkphp
thinkphp / Edit Distance.java
Created May 17, 2026 13:14
Edit Distance.java
import java.util.*;
/*
-------------------------------------
Edit Distance = Distanta Levenshstein
-------------------------------------
Distanta Levenshtein este o masura care cuantifica cat de diferite sunt doua siruri de caractere
prin numarul minim de operatii necesare ptrneu a transforma un sir in altil.
@thinkphp
thinkphp / gist:44192ebf4bd4c99f63e140dc2e19dc2c
Created May 17, 2026 12:27
metoda 3 cu distanta euclidiana Puncte coliniare
A x Point(1)
B x Point(2)
C x Point(3)
@thinkphp
thinkphp / ClosestPairPoints.java
Created May 17, 2026 12:18
ClosestPairPoints.java
import java.util.*;
/*
Distanta minima dintre mai multe puncte
|
| x x
| x
| x x
| x
@thinkphp
thinkphp / merge-sorted-linkedlists.java
Last active May 17, 2026 11:42
merge-sorted-linkedlists.java
/*
1 -> 2 -> 4
1 -> 3 -> 4
*/
class ListNode {
int val;
ListNone next;
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
// ============================================================
// Proiect Carte de Vizita ----> Clasa de baza
// ============================================================
class CarteDeVizita {
protected:
@thinkphp
thinkphp / SinglyLinkedList.java
Last active May 10, 2026 14:23
SinglyLinkedList Data Structure
/*
Array =
int a
Data Structures
---------------
Singly Linked List (Liste Simplu Inlantuite)
Double Linked List (Dublu)