- 博客(27)
- 收藏
- 关注
原创 MySQL5.5免安装,设置密码
mysqld –install MySQL --defaults-file=”D:\protable\MySQL Server 5.5\my.ini” net start mysql net stop mysql use mysql; select user,host,password from user; - update user set password=password('root') where user='root'; update user set authentication_.
2021-09-21 21:10:20
318
原创 计算机组成原理(一)
计算机的发展历程 集成电路和芯片的区别? 冯诺依曼体系 哈佛结构 编译执行和解释执行 计算机的层次结构 计算机的度量单位 容量单位 速度单位 网速 CPU时钟频率 字符编码 ASCII码及其扩展 ASCII表及其扩展在线查询 `GB2312`和`GBK` `Unicode`和`UTF-8`
2021-07-14 22:57:24
608
原创 动态规划——最长公共子序列
#include<stdio.h> #include<string.h> #define max(a, b) a > b ? a : b #define N 1010 char x[N], y[N]; int dp[N][N]; int main() { scanf("%s%s", x+1, y+1); int lx = strlen(x+1), ly = strlen(y+1); int i, j; for(i = 1; i <=
2021-05-09 23:42:45
135
原创 贪心——活动安排
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; const int N = 1010; int T, n; class act{ public: int s; int f; }; bool cmp(act x1, act x2) { return x1.f < x2.f; } int main() { // Ca
2021-05-08 22:51:34
150
原创 Java集合——Collections和Arrays
Collections和Arrays Collections可以创建、操作、和包装集合(包装为线程安全,或不可修改) Arrays可以操作数组,把数组转换成List接口的类型 Collections // 为包装的集合提供线程安全性 // 通过包装集合修改集合后,改动也会体现在原集合身上;反之亦然 List<String> list = Collections.synchronizedList(new ArrayList<>());
2021-05-05 22:12:51
302
原创 动态规划——矩阵连乘
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N = 650; int T, n; int m[N][2]; int dp[N][N]; // dp[i][j] 表示矩阵m[j] ~ m[j]的最小乘法次数 int main() { cin >> T; whil
2021-05-05 18:15:09
129
原创 Java集合——Set、SortedSet
Set Set接口比Collection接口多了Set.of和Set.copyOf静态工厂方法 它们提供了创建不可修改集的便捷方法 但是,如果包含的元素本身是可变的,则可能导致Set表现不一致或其内容似乎发生变化。 Set为什么把从Collection继承的抽象方法又重新写了一遍 文档有说明 The Set interface places additional stipulations, beyond those inherited from the Collection interface, on
2021-05-05 17:37:37
418
原创 Java集合概述——Collection接口
Collection 怎么创建集合 一些常用的方法 集合怎么转换为数组obj.toArray 数组怎么转换为集合 Arrays.asList 集合怎么迭代Iterable 什么是可选方法 创建Collection对象 通过实现类创建对象 Collection<String> c1 = new HashSet<>(); Collection<String> c2 = new TreeSet<>(); Collection<String> c.
2021-05-05 17:34:04
146
原创 三种快速排序
/** * 3种快排的实现方式,1是不适合重复元素多,2可以适应重复元素多(建议使用),3可以优化重复元素多的时间 */ public class Code_07_QuickSort { public static void quickSort(int[] arr) { if (arr == null || arr.length < 2) { return; } int L = 0, R = arr.length - 1; quickSort(arr, L, R); }
2020-10-30 12:23:24
233
原创 分治——棋盘覆盖
棋盘覆盖 视频讲解东北大学慕课 [video(video-BWWlnR2Z-1604030474317)(type-bilibili)(url-https://player.bilibili.com/player.html?aid=100009146)(image-https://ss.youkuaiyun.com/p?http://i1.hdslb.com/bfs/archive/0f5367f1930cc6d4528cc364c2f7afb02a45c13d.jpg)(东北大学慕课)] 问题描述 在一个2k×2k.
2020-10-30 12:02:53
320
原创 链表的排序算法
介绍:交换节点法的冒泡排序及优化 1.数组实现 #include <cstdio> typedef long long ll; using namespace std; void out(ll a[], ll n) { for(int i = 0; i < n; i++) printf("%lld ", a[i]); printf("\n"...
2019-09-25 20:41:55
410
原创 指针数组
char *a[100]; strcpy(a[1], a[0]); 为什么都是错的? 原因:传进去的a[1],是一个地址,但因为a[1] 里的地址是指向文字常量区的,而上面strcpy函数的实现是 char * strcpy(char * dst, const char * src) { char * cp = dst; while( *cp++ =...
2019-09-15 10:43:02
141
原创 第四周 运算符的重载
运算符重载 运算符重载,就是对已有的运算符(C++中预定义的运算符)赋予多 重的含义,使同一运算符作用于不同类型的数据时导致不同类型的 行为。 运算符重载的目的是:扩展C++中提供的运算符的适用范围,使之 能作用于对象。 同一个运算符,对不同类型的操作数,所发生的行为不同。 complex_a + complex_b 生成新的复数对象 5 + 4 = 9 运算符重载的形式 运算符重载的实质是函...
2019-08-03 18:50:30
217
原创 局部变量能开多大
一个 int 类型变量占4个字节或8个字节 用户能从栈获得的空间较小,通常为1M,也有2M的。 以四个字节为例,1M的栈空间为例 1M = 1024KB = 1024*1024B(Byte(字节)) = 1048576 字节 by the way 1B = 8bit 1048576/4 = 262144 int arr[262144]就是限制条件下的最大数组 实验发现要比这大...
2019-05-27 18:17:57
232
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅