上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 43 下一页

2020年7月29日

极客mysql16

摘要: 1.MySQL会为每个线程分配一个内存(sort_buffer)用于排序该内存大小为sort_buffer_size 1>如果排序的数据量小于sort_buffer_size,排序将会在内存中完成 2>如果排序数据量很大,内存中无法存下这么多数据,则会使用磁盘临时文件来辅助排序,也称外部排序 3>在 阅读全文

posted @ 2020-07-29 11:29 wsw_seu 阅读(163) 评论(0) 推荐(0) 编辑

2020年7月26日

299. Bulls and Cows

摘要: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文

posted @ 2020-07-26 21:11 wsw_seu 阅读(108) 评论(0) 推荐(0) 编辑

leetcode microsoft

摘要: https://leetcode.com/discuss/interview-question/398023/Microsoft-Online-Assessment-Questions 阅读全文

posted @ 2020-07-26 20:10 wsw_seu 阅读(102) 评论(0) 推荐(0) 编辑

面试题 02.04. 分割链表

摘要: 编写程序以 x 为基准分割链表,使得所有小于 x 的节点排在大于或等于 x 的节点之前。如果链表中包含 x,x 只需出现在小于 x 的元素之后(如下所示)。分割元素 x 只需处于“右半部分”即可,其不需要被置于左右两部分之间。 示例: 输入: head = 3->5->8->5->10->2->1, 阅读全文

posted @ 2020-07-26 19:48 wsw_seu 阅读(173) 评论(0) 推荐(0) 编辑

295. Find Median from Data Stream

摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文

posted @ 2020-07-26 19:23 wsw_seu 阅读(189) 评论(0) 推荐(0) 编辑

动态规划题解(转)

摘要: 动态规划算法似乎是一种很高深莫测的算法,你会在一些面试或算法书籍的高级技巧部分看到相关内容,什么状态转移方程,重叠子问题,最优子结构等高大上的词汇也可能让你望而却步。 而且,当你去看用动态规划解决某个问题的代码时,你会觉得这样解决问题竟然如此巧妙,但却难以理解,你可能惊讶于人家是怎么想到这种解法的。 阅读全文

posted @ 2020-07-26 18:16 wsw_seu 阅读(320) 评论(0) 推荐(0) 编辑

2020年7月25日

C/C++中内存对齐问题的一些理解(转)

摘要: 内存对齐指令 一般来说,内存对齐过程对coding者来说是透明的,是由编译器控制完成的 如对内存对齐有明确要求,可用#pragma pack(n)指定,以n和结构体中最长数据成员长度中较小者为有效值 如未明确指定时,以结构体中最长的数据成员长度作为内存对齐的有效值 以下如没有特殊说明,均视为情况3( 阅读全文

posted @ 2020-07-25 17:07 wsw_seu 阅读(156) 评论(0) 推荐(0) 编辑

利用c++ std::getline实现split

摘要: getline reads characters from an input stream and places them into a string: getline从输入流中读取字符, 并把它们转换成字符串. getline(input, str, delim), 默认的分隔符是’\n’字符. 阅读全文

posted @ 2020-07-25 16:29 wsw_seu 阅读(1138) 评论(0) 推荐(0) 编辑

ostringstream、istringstream、stringstream(转)

摘要: 看一下C++风格的串流控制,C++引入了ostringstream、istringstream、stringstream这三个类,要使用他们创建对象就必须包含sstream.h头文件。 istringstream类用于执行C++风格的串流的输入操作。 stringstream类同时可以支持C++风格 阅读全文

posted @ 2020-07-25 16:28 wsw_seu 阅读(516) 评论(0) 推荐(0) 编辑

C++ Split string into vector<string> by space(转)

摘要: c++中没有这么方便的实现,但也有很多的方法能实现这个功能,下面列出五种常用的实现的方法,请根据需要选择,个人觉得前三种使用起来比较方便,参见代码如下: #include <vector> #include <iostream> #include <string> #include <sstream 阅读全文

posted @ 2020-07-25 16:07 wsw_seu 阅读(230) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 43 下一页

导航