- 博客(12)
- 收藏
- 关注
转载 判断链表是否相交,如有,求相交的节点
https://blog.csdn.net/luckyxiaoqiang/article/details/70740221. 给出两个单向链表的头指针pHead1和pHead2,判断这两个链表是否相交。假设两个链表均不带环。示意图如下:如果两个链表相交于某一节点,那么在这个相交节点之后的所有节点都是两个链表所共有的。也就是说,如果两个链表相交,那么最后一个节点肯定是共有的。先遍历第...
2019-11-26 21:35:08 159
转载 LeetCode - 删除链表的倒数第N个节点
参考:https://blog.csdn.net/biezhihua/article/details/79889987,写的特别好。以下是我的实现:题目给定一个链表,删除链表的倒数第 n 个节点并返回头结点。例如,给定一个链表: 1->2->3->4->5, 并且 n = 2.当删除了倒数第二个节点后链表变成了 1->2->3->5...
2019-05-21 20:42:41 92
转载 LeetCode 232. 用栈实现队列
参考:https://blog.csdn.net/snchenjt/article/details/46874771,写的特别好,以下是我的代码:题目描述:用栈实现队列使用栈实现队列的下列操作:push(x) -- 将一个元素放入队列的尾部。pop() -- 从队列首部移除元素。peek() -- 返回队列首部的元素。empty() -- 返回队列是否为空。注意:你只能...
2019-05-21 16:54:52 109
转载 Leet Code OJ 21. Merge Two Sorted Lists [Difficulty: Easy]
参考https://blog.csdn.net/lnho2015/article/details/50801842,写得特别好,以下是我的代码:题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes o...
2019-05-21 16:42:07 102
转载 LeetCode-1:Two Sum (固定和的元素的索引)
参考:https://blog.csdn.net/Koala_Tree/article/details/78291899写得很好。我的代码如下:QuestionGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You ...
2019-05-15 19:39:39 138
转载 LeetCode-670:Maximum Swap (交换数字得最大整数) -- medium
参考:https://blog.csdn.net/Koala_Tree/article/details/78476337,写的特别好。我的代码实现如下:QuestionGiven a non-negative integer, you could swap two digits at most once to get the maximum valued number. Retur...
2019-05-15 19:39:33 513
转载 leecode_1-旋转数组后找最小值
参考:https://www.cnblogs.com/edisonchou/p/4746561.html写得特别好。就直接copy过来了。以下是我的代码:一、题目:旋转数组的最小数字题目:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,...
2019-05-15 19:39:18 126
转载 Leet Code OJ 20. Valid Parentheses [Difficulty: Easy]
我的代码如下:参考:https://blog.csdn.net/Lnho2015/article/details/50970920题目:Given a string containing just the characters , determine if the input string is valid.The brackets must close in the corr...
2019-05-14 20:03:11 108
原创 修改httpclient-4.3.3源码,并重新打包
一、背景介绍:在跟踪java后台采用rest_template发起httpclient调用的时候,发现有一个ClientProtocolException,以下为异常信息堆栈:根据以上堆栈信息,跟踪到DefaultHttpResponse的parseHead方法中,解析response的协议头出现了问题,由于这个bug的偶发性比较大(大概1000次偶发1次,而且不定时)现决定对ht
2016-06-12 14:26:24 650
原创 curl 读取cookie并进行测试
1、首先登陆网站,采用firebug获得cookie,然后导出所有的cookie2、查看导出的cookie文件格式为:刚好这个文件格式 与 curl的格式非常匹配。3、执行curl命令: for i in $(seq 1000);do curl -b cookie "http://kec.console.ksyun.com:8080/console-net
2016-06-07 19:41:44 1556
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人