Skip to content

Instantly share code, notes, and snippets.

View longluo's full-sized avatar
💭
I may be slow to respond.

Frank Luo longluo

💭
I may be slow to respond.
View GitHub Profile
@longluo
longluo / FFT.cpp
Last active June 17, 2022 07:04
Fast Fourier Transform FFT 快速傅里叶变换
‎‎​
@longluo
longluo / Sorting.java
Last active June 14, 2022 06:10
Sorting 排序
‎‎​
@longluo
longluo / BinarySearch.java
Last active June 14, 2022 06:11
BinarySearch 二分查找
/**
* Binary Search
* 二分查找
*
* Returns the index of the specified target in the specified array.
*
* @param arr the array of integers, must be sorted in ascending order
* @param target the search target
* @return index of key in array {@code arr} if present; {@code -1} otherwise
*/
@longluo
longluo / Fibonacci.java
Created June 14, 2022 03:13
Fibonacci Algorithm
‎‎​
@longluo
longluo / prime.java
Last active June 14, 2022 06:11
Prime Number
/**
* 判断数字是否是一个质数
*
* check is a prime number
*
*/
boolean isPrime(int n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;