07 2020 档案

摘要:一、Http和Https的基本概念 Http:超文本传输协议(Http,HyperText Transfer Protocol)是互联网上应用最为广泛的一种网络协议。设计Http最初的目的是为了提供一种发布和接收HTML页面的方法。它可以使浏览器更加高效。Http协议是以明文方式发送信息的,如果黑客 阅读全文
posted @ 2020-07-06 21:48 John_yan15 阅读(209) 评论(0) 推荐(0)
摘要:题目: 求给定的二叉树的前序遍历。 例如: 给定的二叉树为{1,#,2,3}, 1 2 / 3 返回:[1,2,3] 代码: 1 /** 2 * struct TreeNode { 3 * int val; 4 * struct TreeNode *left; 5 * struct TreeNode 阅读全文
posted @ 2020-07-06 17:27 John_yan15 阅读(196) 评论(0) 推荐(0)
摘要:题目: 将给定的单链表L: L 0→L 1→…→L n-1→L n, 重新排序为: L 0→L n →L 1→L n-1→L 2→L n-2→… 要求使用原地算法,并且不改变节点的值 例如: 对于给定的单链表{1,2,3,4},将其重新排序为{1,4,2,3}. Given a singly lin 阅读全文
posted @ 2020-07-06 17:21 John_yan15 阅读(176) 评论(0) 推荐(0)
摘要:题目: 对于一个给定的链表,返回环的入口节点,如果没有环,返回null 拓展: 你能给出不利用额外空间的解法么? Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull 阅读全文
posted @ 2020-07-06 17:17 John_yan15 阅读(172) 评论(0) 推荐(0)
摘要:题目: 在O(n log n)的时间内使用常数级空间复杂度对链表进行排序。 Sort a linked list in O(n log n) time using constant space complexity. 示例; 输入:{3,2,4} 输出:{2,3,4} 代码: 1 /** 2 * s 阅读全文
posted @ 2020-07-02 22:35 John_yan15 阅读(186) 评论(0) 推荐(0)
摘要:题目: 使用插入排序对链表进行排序。 Sort a linked list using insertion sort. 示例: 输入:{3,2,4} 输出:{2,3,4} 代码: 1 /** 2 * struct ListNode { 3 * int val; 4 * struct ListNode 阅读全文
posted @ 2020-07-02 22:25 John_yan15 阅读(162) 评论(0) 推荐(0)
摘要:题目: 求给定的二叉树的后序遍历。 例如: 给定的二叉树为{1,#,2,3}, 返回[3,2,1]. 备注;用递归来解这道题太没有新意了,可以给出迭代的解法么? 示例: 输入:{1,#,2,3} 输出:[3,2,1] 代码: 1 /** 2 * struct TreeNode { 3 * int v 阅读全文
posted @ 2020-07-02 22:14 John_yan15 阅读(168) 评论(0) 推荐(0)
摘要:题目: 对于给定的n个位于同一二维平面上的点,求最多能有多少个点位于同一直线上 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 示例: 输入:[(0 阅读全文
posted @ 2020-07-02 13:42 John_yan15 阅读(192) 评论(0) 推荐(0)