- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 20190819-社招记录
两个题都比较简单1.打印对角线输入 n = 3,矩阵是这样的:1 2 34 5 67 8 9打印结果:12 43 5 76 8932 61 5 94 87public class DidiMatrix { public void getResult(int n) { if (n <= 0) { return;...
2019-08-22 18:03:32
151
原创 http返回码
HTTP协议状态码表示的意思主要分为五类 ,大体是 : 1×× 保留 2×× 表示请求成功地接收 3×× 为完成请求客户需进一步细化请求 4×× 客户错误 5×× 服务器错误 返回码列表如下:代码消息描述100Continue只有请求的一部分
2017-08-06 18:18:09
276
原创 Go语言实现一键多值的Map
照着源码,实现了Go语言,一键多值的Mappackage maintype Multimap map[string][]stringtype keyValues struct { key string values []string}func (multimap Multimap) Add(key, value string) {
2017-07-20 17:40:53
3529
原创 排序数组分成若干子数组
List list = Lists.newArrayList(); list.add(1); list.add(1); list.add(2); list.add(2); List> lists = Lists.newArrayList(); int from = 0, to = 1;
2017-07-04 18:07:46
623
原创 Java中equals与==的区别
写这篇文章的原因是,真的被它坑到了对于这个题目,我在校招的时候听同学反复强调它们之间的区别,当时学C++,没有特别在意,如今真的碰到这个问题,就总结一下 在比较两个String类型的数据是否相等时,按照我以前学C++的套路会是这样代码一:String str1 = new String("liu");String str2 = new Stri
2017-07-02 11:29:23
233
原创 二叉树非递归遍历(C++版本)
二叉树非递归遍历有三种方式:前序遍历、中序遍历、后续遍历前序遍历class Solution {public: vector preorderTraversal(TreeNode* root) { vector res; stack s; while (root || !s.empty()){
2017-06-30 17:18:44
570
1
原创 Java获取时间
利用Java中Calendar类,来获取各种时间,并转换为字符串本文持续更新中......// 昨天public static String getYesterday() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calenda
2017-06-24 17:37:10
188
原创 Leetcode : 23. Merge k Sorted Lists
题目描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路采用分治法的思想,把链表数组分开,对于两个链表而言,采用循环遍历的方式进行排序程序/** * Definition for singly-
2017-06-24 11:16:36
222
原创 Leetcode : 25. Reverse Nodes in k-Group
题目描述Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the
2017-06-24 11:02:54
210
原创 Java关于对象引用问题
本文通过代码来验证,使用类生成的对象作为参数传递时,传递的是引用即新生成一个对象,把它作为传递的参数,不会生成额外的对象,全程使用的是该对象 如下所示,为一个Person类public class Person implements Serializable { private static final long serialVersionUID =
2017-06-24 10:47:21
289
原创 剑指Offer : 数组中的逆序对
题目描述在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数P。并将P对1000000007取模的结果输出。 即输出P%1000000007 输入描述:题目保证输入的数组中没有的相同的数字数据范围:对于%50的数据,size对于%75的数据,size对于%100的数据,size
2016-09-03 02:00:27
319
原创 Leetcode 212. Word Search II
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those hor
2016-09-03 00:21:26
278
原创 Leetcode 385. Mini Parser
问题描述:Given a nested list of integers represented as a string, implement a parser to deserialize it.Each element is either an integer, or a list -- whose elements may also be integers or othe
2016-08-14 23:38:32
626
原创 C++ 链栈实现
#include using namespace std;template class LinkStackNode{public:T data;LinkStackNode* next;LinkStackNode(T &d):data(d),next(NULL){}};template class LinkStack{public:
2015-05-13 16:16:52
1131
QuaZIP库文件
2015-09-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人