Skip to content

Instantly share code, notes, and snippets.

View htoann's full-sized avatar
🌠
Going to Caldwell 6

Trần Hữu Toàn htoann

🌠
Going to Caldwell 6
View GitHub Profile
@htoann
htoann / Hotels
Created December 2, 2022 09:40
Hotels
// 20221202164025
// https://bookings.up.railway.app/api/hotels
[
{
"_id": "6360ed35641f3df2dce2bc72",
"title": "Mövenpick Resort Waverly Phu Quoc",
"type": "resorts",
"desc": "Located in Phú Quốc, a 4-minute walk from Ong Lang Beach, Mövenpick Resort Waverly Phu Quoc has accommodations with a restaurant, free private parking, free bikes and an outdoor swimming pool. Among the various facilities of this property are a fitness center, a bar and a garden. The property provides a 24-hour front desk, room service and currency exchange for guests. Free WiFi is accessible to all guests, while certain rooms contain a patio. The resort offers a buffet or American breakfast. Mövenpick Resort Waverly Phu Quoc has a sun terrace. The area is popular for cycling, and car rental is available at the accommodation. Vinpearl Land Phu Quoc is 11.6 km from Mövenpick Resort Waverly Phu Quoc, while Corona Casino is 11.7 km from the property. The nearest airport is Phu Quoc International, 17.7 km from the resort
@htoann
htoann / Tiktok API
Last active May 23, 2023 16:38
Tiktok API
{
"info": {
"_postman_id": "6ea46510-3f0c-4367-83bc-da66ddebc8da",
"name": "Tiktok API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "17115154",
"lmao": "https://tiktok.fullstack.edu.vn/api/"
"fix": "posts === videos"
},
"item": [
@htoann
htoann / DSLK
Created June 14, 2022 04:15
DSLK
#include<iostream>
using namespace std;
class Node
{
public:
int data; //khoi tao data
class Node *pNext; //khoi tao con tro
};
typedef class Node NODE; // khoi tao ten cua lop
@htoann
htoann / AVL
Created June 13, 2022 13:50
AVL
#include <iostream>
#include <cmath>
#define COUNT 10
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
@htoann
htoann / Lmao
Last active June 13, 2022 13:42
Lmao
http://liveexample.pearsoncmg.com/liang/animation/web/AVLTree.html
Chuỗi con chung dài nhất :
+ Nếu bằng thì đường chéo trên + 1
+ Nếu khác thì max 2 bên
// Chuỗi con đối xứng :
// + Nếu bằng thì lấy đường chéo trên
// + Nếu khác => lấy max 2 bên
// Done
@htoann
htoann / Trực Thăng
Created June 13, 2022 09:36
Trực Thăng
#include<bits/stdc++.h>
using namespace std;
int * kq, * chon, * v; // các m?ng
int n, dem = 0;
void khoitao() {
n = 8;
v = new int[n];
v[0] = 5;
v[1] = 4;
@htoann
htoann / Queue
Last active June 12, 2022 07:18
Queue
• Các phần tử cùng kiểu
• Số phần tử không cố định
• Các phần tử được đưa vào ở đuôi hàng đợi và lấy ra ở đầu hàng đợi
• Hàng đợi hoạt động theo cơ chế FIFO (First In First Out)
Ví dụ:
- Xếp hàng vô thang máy
- Máy in trong mạng
class Queue {
struct Node {
int data;
@htoann
htoann / Stack
Last active June 12, 2022 07:02
Stack
• Các phần tử cùng kiểu
• Số phần tử không cố định
• Các phần tử được đưa vào và lấy ra ở đỉnh ngăn xếp
• Ngăn xếp hoạt động theo cơ chế LIFO (Last In First Out)
Ví dụ:
- Chồng đĩa khi rửa + Chồng đĩa khi đưa ra phục vụ
class Stack {
struct Node {
int data;
@htoann
htoann / Josephus
Last active June 12, 2022 07:17
Josephus
#include <bits/stdc++.h>
using namespace std;
void josephus2(int n, int k) {
queue < int > q;
for (int i = 1; i <= n; i++) q.push(i);
int d = n, v = 0, x;
while (d > 1) {
int x = q.front();
q.pop();
@htoann
htoann / Con Kiến
Created June 12, 2022 05:08
Con Kiến
#include <bits/stdc++.h>
using namespace std;
long long ck_dp1(int m, int n) {
long long * a;
a = new long long[n + 1];
for (int i = 0; i <= n; i++) a[i] = 1;
for (int i = 1; i <= m; i++)
for (int j = 1; j <= n; j++)
a[j] = a[j - 1] + a[j];