摘要: 1 package org.example.algorithm.datastruct; 2 3 import java.util.ArrayList; 4 import java.util.Comparator; 5 import java.util.List; 6 7 public class H 阅读全文
posted @ 2023-12-11 10:29 张时雨 阅读(16) 评论(0) 推荐(0)
摘要: package org.example.algorithm.datastruct; import java.util.Comparator; import java.util.function.Consumer; public class BinarySearchTree<T> { /** * 比较 阅读全文
posted @ 2023-12-10 22:31 张时雨 阅读(13) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> void swap(int *x, int *y) { int t = *x; *x = *y; *y = t; } int partition(int arr[], int p, int q) { swap(arr + 阅读全文
posted @ 2022-07-04 00:05 张时雨 阅读(44) 评论(0) 推荐(0)
摘要: #include <stdio.h> const int pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; #define get_digit(num, n) ((num) % 阅读全文
posted @ 2022-07-03 02:52 张时雨 阅读(23) 评论(0) 推荐(0)
摘要: #include <stdio.h> void counting_sort(const int arr[], int size, int target[], int k) { int count[k + 1]; for (int i = 0; i <= k; ++i) { count[i] = 0; 阅读全文
posted @ 2022-07-03 00:41 张时雨 阅读(24) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> void swap(int *x, int *y) { int t = *x; *x = *y; *y = t; } int partition(int arr[], int p, int q) { swap(arr + 阅读全文
posted @ 2022-07-02 23:03 张时雨 阅读(24) 评论(0) 推荐(0)
摘要: #include <stdio.h> void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; } int parent(int index) { return (index - 1) / 2; } int left(int index) { 阅读全文
posted @ 2022-07-02 19:38 张时雨 阅读(30) 评论(0) 推荐(0)