1 """ 2 We are given a linked list with head as the first node. Let's number the nodes in the list: node_1, node_2, node_3, ... etc. 3 4 Each node may ...
分类:
其他好文 时间:
2020-02-01 23:17:32
阅读次数:
75
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:
其他好文 时间:
2020-02-01 19:43:59
阅读次数:
85
1、题目 21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes ...
分类:
其他好文 时间:
2020-02-01 19:06:49
阅读次数:
102
There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v ...
分类:
Web程序 时间:
2020-01-31 10:26:07
阅读次数:
77
合并 k 个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。 本题我掌握了两个方法: 1. 遍历所有链表,将其 nodes 的 val 放入一个list, 然后list.sort(),然后再放入链表result O(NlogN) 2. 就是我用的方法,先写合并两个链表的函数,再分而治之的合 ...
分类:
编程语言 时间:
2020-01-30 19:06:36
阅读次数:
85
1、Https过程 2、Nginx配置https 1)生成私钥和公钥 命令:openssl req -x509 -newkey rsa:2048 -nodes -sha256 -keyout localhost-privkey.pem -out localhost-cert.pem 2、配置test ...
分类:
Web程序 时间:
2020-01-28 21:16:38
阅读次数:
99
又是链表的题目,本题要求将所有nodes 向右移动K位 我初步的想法是把其所有val添加到 容器中 ,like List , 然后再List里操作完了再放入链表,让我先去看看答案。 答案: 先将链表变成环状,然后再从移动好之后的位置打开。 OK,我写完了,中间有几个细节需要注意 class Solu ...
分类:
其他好文 时间:
2020-01-28 12:33:39
阅读次数:
66
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:
其他好文 时间:
2020-01-26 16:10:12
阅读次数:
98
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:
其他好文 时间:
2020-01-26 14:40:36
阅读次数:
61
题目描述: 给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。 示例: 给定 1 2 3 4,你应该返回 2 1 4 3. 注意事项 1、不能简单的交换数值,而是需要更改指针,即确实更改了节点; 2、如果节点个数是奇数,如下图: ...
分类:
编程语言 时间:
2020-01-24 09:15:02
阅读次数:
108