Skip to content

Commit

Permalink
docs: 牛客算法文档更新
Browse files Browse the repository at this point in the history
  • Loading branch information
chufan committed Sep 13, 2023
1 parent 2b8a331 commit 1744848
Show file tree
Hide file tree
Showing 21 changed files with 207 additions and 9 deletions.
17 changes: 17 additions & 0 deletions code/algorithm/interview-101/entryNodeOfLoop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* function ListNode(x){
this.val = x;
this.next = null;
} */


/**
* 【中等】链表中环的入口结点
* @param pHead
* @constructor
*/
function entryNodeOfLoop(pHead) {
// write code here
}
module.exports = {
entryNodeOfLoop
}
17 changes: 17 additions & 0 deletions code/algorithm/interview-101/findFirstCommonNode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* function ListNode(x){
this.val = x;
this.next = null;
} */

/**
* 【简单】 两个链表的第一个公共结点
* @param pHead1
* @param pHead2
* @constructor
*/
function findFirstCommonNode(pHead1, pHead2) {
// write code here
}
module.exports = {
findFirstCommonNode
}
4 changes: 1 addition & 3 deletions code/algorithm/interview-101/findKthToTail.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ function ListNode(x) {
this.next = null
}
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* 【简单】 链表中倒数最后k个结点
* @param pHead ListNode类
* @param k int整型
* @return ListNode类
Expand Down
11 changes: 11 additions & 0 deletions code/algorithm/interview-101/hasCycle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* 【简单】判断链表中是否有环
* @param head ListNode类
* @return bool布尔型
*/
function hasCycle(head) {
// write code here
}
module.exports = {
hasCycle
}
11 changes: 11 additions & 0 deletions code/algorithm/interview-101/mergeLists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* 【较难】合并k个已排序的链表
* @param lists ListNode类一维数组
* @return ListNode类
*/
function mergeKLists(lists) {

}
module.exports = {
mergeKLists
}
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions docs/manuscripts/solo-algorithm/interview-101/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
- [ ] [2.链表内指定区间反转 【中等】](链表/reverseBetween.md)
- [ ] [3.链表中的节点每k个一组翻转 【中等】](链表/reverseGroup.md)
- [ ] [4.合并两个排序的链表 【简单】](链表/merge.md)
- [ ] [5.合并k个已排序的链表 【较难】](链表/reverseList.md)
- [ ] [6.判断链表中是否有环 【简单】](链表/reverseList.md)
- [ ] [7.链表中环的入口结点 【中等】](链表/reverseList.md)
- [ ] [8.链表中倒数最后k个结点 【简单】](链表/reverseList.md)
- [ ] [9.删除链表的倒数第n个节点 【中等】](链表/reverseList.md)
- [ ] [10.两个链表的第一个公共结点 【简单】](链表/reverseList.md)
- [ ] [5.合并k个已排序的链表 【较难】](链表/mergeKLists.md)
- [ ] [6.判断链表中是否有环 【简单】](链表/hasCycle.md)
- [ ] [7.链表中环的入口结点 【中等】](链表/entryNodeOfLoop.md)
- [ ] [8.链表中倒数最后k个结点 【简单】](链表/findKthToTail.md)
- [ ] [9.删除链表的倒数第n个节点 【中等】](链表/removeNthFromEnd.md)
- [ ] [10.两个链表的第一个公共结点 【简单】](链表/findFirstCommonNode.md)
- [ ] [11.链表相加(二) 【中等】](链表/reverseList.md)
- [ ] [12.单链表的排序 【中等】](链表/reverseList.md)
- [ ] [13.判断一个链表是否为回文结构 【简单】](链表/reverseList.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BM7 链表中环的入口结点




### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694593953358)
- [欢迎讨论]()

### 题目描述

![反转链表.png](../images/entryNodeOfLoop.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/entryNodeOfLoop.js)


### 一些建议
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BM8 链表中倒数最后k个结点




### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694594781904)
- [欢迎讨论]()

### 题目描述

![反转链表.png](../images/findFirstCommonNode.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/findFirstCommonNode.js)


### 一些建议
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BM8 链表中倒数最后k个结点




### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694594062276)
- [欢迎讨论]()

### 题目描述

![反转链表.png](../images/findKthToTail.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/findKthToTail.js)


### 一些建议
24 changes: 24 additions & 0 deletions docs/manuscripts/solo-algorithm/interview-101/链表/hasCycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BM6 判断链表中是否有环




### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694589556195)
- [欢迎讨论]()

### 题目描述

![反转链表.png](../images/hasCycle.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/hasCycle.js)


### 一些建议
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# BM5 合并k个已排序的链表




### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694589240005)
- [欢迎讨论]()

### 题目描述

![反转链表.png](../images/mergeLists.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/mergeLists.js)


### 一些建议
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@


# BM9 删除链表的倒数第n个节点


### 题目链接

- [牛客网](https://www.nowcoder.com/share/jump/8484115461694594387319)
- [欢迎讨论]()

### 题目描述

![区间反转.png](../images/removeNthFromEnd.png)



### 思路

### 代码实现

@[code js](@code/algorithm/interview-101/removeNthFromEnd.js)


### 一些建议

0 comments on commit 1744848

Please sign in to comment.