动态规划题,根据动态规划,选择最短的路径 class Solution { public: int minimumTotal(vector<vector<int>>& triangle) { int n = triangle.size(); vector<int> f(n); f[0] = tria ...
分类:
其他好文 时间:
2021-03-31 12:26:06
阅读次数:
0
template<typename T> void funcTmp(T a, T b) { cout << "this is yiban" << endl; } template<> void funcTmp(const char* a, const char* b) { cout << "this ...
分类:
编程语言 时间:
2021-03-31 12:19:34
阅读次数:
0
自定义学生类 public class Student { public int Id { get; set; } public string Name { get; set; } public int ClassId { get; set; } public int Age { get; set; ...
分类:
其他好文 时间:
2021-03-31 12:08:29
阅读次数:
0
HelloWorld 随便新建一个文件夹,存放代码 如:Code\ 新建一个Java文件 文件后缀名为.java Hello.java [注意点]系统可能没有显示文件后缀名,我们需要手动打开 编写代码 public class Hello{ public static void main(Strin ...
分类:
其他好文 时间:
2021-03-31 12:05:24
阅读次数:
0
public class MergeSort { //基本思想为分治法,将有序的子序列合并,得到有序的序列。先使每个子序列有序,再使子序列段间有序。 //当有 n 个记录时,需进行 logn 轮归并排序,每一轮归并比较次数不超过 n,元素移动次数为 n,因此时间复杂度为 O(nlogn)。 //归并 ...
分类:
编程语言 时间:
2021-03-31 12:01:17
阅读次数:
0
Stream流初体验 案例需求 按照下面的要求完成集合的创建和遍历 创建一个集合,存储多个字符串元素 把集合中所有以"张"开头的元素存储到一个新的集合 把"张"开头的集合中的长度为3的元素存储到一个新的集合 遍历上一步得到的集合 原始方式示例代码 public class StreamDemo { ...
分类:
其他好文 时间:
2021-03-31 11:55:09
阅读次数:
0
class Solution { public static void main(String[] args) { int[] arr = new int[]{0, 1, 2, 2, 2, 3, 4, 5}; //int index = binarySearch(arr, 2); //int ind ...
分类:
其他好文 时间:
2021-03-31 11:46:55
阅读次数:
0
插入排序 最佳情况:T(n) = O(n) 最坏情况:T(n) = O(n2) 平均情况:T(n) = O(n2) public int[] insertionSort(int[] array) { if (array.length == 0) { return array; } int curre ...
分类:
编程语言 时间:
2021-03-31 11:43:47
阅读次数:
0
@Cacheable(value = "CACHE_BOOK",key = "#username", condition = "#language = 1") public List<Book> getBooksByUsernameAndLanguage(String username, int l ...
分类:
编程语言 时间:
2021-03-30 13:51:01
阅读次数:
0
在添加图片 请求到方法接收 open打开当前的图片路径 text 第一个参数时你要添加的水印是 第二个参数是路径 public function imlist(){ // 获取表单上传文件 例如上传了001.jpg $file = request()->file('img'); // 移动到框架应用 ...
分类:
Web程序 时间:
2021-03-30 13:35:21
阅读次数:
0