上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: #include <iostream> using namespace std; /** * 将前N个圆盘从from搬运到to通过辅助help * @param N * @param from * @param to */ void hanoi(int N, char from, char to, 阅读全文
posted @ 2023-02-03 21:25 破忒头头 阅读(36) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> using namespace std; /** * 插入排序 * 概述:当前i的前面的元素都是有序的,将i索引处的元素插入到前面有序区域合适的位置。 * 时间复杂度:平均情况下,插入排序需要比较(N^2)/4次比较和(N^ 阅读全文
posted @ 2023-02-03 14:21 破忒头头 阅读(39) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> using namespace std; /** * 选择排序 * 首先找到数组中最小的元素和第一个元素进行交换 * 再次找到剩下的数组元素中最小的元素和第二个元素进行交换 * 以此类推 * * 算法性能:1.运行时间与输入 阅读全文
posted @ 2023-02-02 22:33 破忒头头 阅读(22) 评论(0) 推荐(0)
摘要: k个k进制的数字进行不进位加法,结果为0 时空复杂度O(n) class Solution { public: string decTok(int dec,int k){ string ret = ""; while(dec){ ret += char(dec%k + '0'); dec /= k; 阅读全文
posted @ 2023-01-30 22:46 破忒头头 阅读(24) 评论(0) 推荐(0)
摘要: 哈希表 时空复杂度 O(n) class Solution { public: vector<int> findNumsAppearOnce(vector<int>& nums) { unordered_map<int,int> m; vector<int> res; for(auto x : nu 阅读全文
posted @ 2023-01-30 21:27 破忒头头 阅读(20) 评论(0) 推荐(0)
摘要: 思路: 将原始数组和添加重复数字的数组相抑或,最后的结果就是重复的数字。 #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(void) { int arr[1001] = {}; 阅读全文
posted @ 2023-01-16 21:05 破忒头头 阅读(63) 评论(0) 推荐(0)
摘要: 背景 在写SSM项目需要Controller直接返回Object对象,在Controller返回时将对象自动解析成Jason字符串,具体步骤如下 @RestController或者@Controller+@ResponseBody注解实现 在springmvc-config.xml文件中加入<mvc 阅读全文
posted @ 2022-12-19 22:36 破忒头头 阅读(26) 评论(0) 推荐(0)
摘要: Mybatis-Spring 版本关系图 当前环境 JDK8 Mybatis-Spring 2.1.0 Mybatis 3.5.11 Log4j 1.2.17 lombok 1.18.24 Spring Framework 5.3.20 Dbcp 2.9.0 🌈参考文档 Spring+Mybati 阅读全文
posted @ 2022-12-17 16:42 破忒头头 阅读(105) 评论(0) 推荐(0)
摘要: FactoryBean 🌈官方地址 可以为本身就是工厂的对象实现org.springframework.beans.factory.FactoryBean接口 FactoryBean 接口是 Spring IoC 容器实例化逻辑的可插入点。 如果您有复杂的初始化代码,最好用 Java 表示,而不是 阅读全文
posted @ 2022-12-16 23:26 破忒头头 阅读(243) 评论(0) 推荐(0)
摘要: Mybatis3 Mybatis 作用域和生命周期 SqlSessionFactoryBuilder 最佳作用域是方法作用域,一旦创建了SqlSessionFactory就不再需要它了。可以重用SqlSessionFactoryBuilder来创建多个SqlSessionFactory实例,但是不要一直保留SqlSe 阅读全文
posted @ 2022-12-16 17:25 破忒头头 阅读(90) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页