新一鸡
新一鸡
全部文章
分类
归档
标签
去牛客网
登录
/
注册
新一鸡的博客
全部文章
(共12篇)
题解 | 深拷贝
const _completeDeepClone = (obj, map = new Map()) => { if(obj===null || typeof obj!=='object')return obj; if(map.has(obj))return map.get(obj); i...
2026-01-28
0
5
题解 | 简易深拷贝
const _sampleDeepClone = target => { return JSON.parse(JSON.stringify(target))} 1. 参数对象和参数对象的每个数据项的数据类型范围仅在数组、普通对象({})、基本数据类型中]2. 无需考虑循环引用...
2026-01-28
0
6
题解 | 二叉树的前序遍历
function preorderTraversal( root ) { // write code here const res=[]; preorder(root,res) return res; } function preorder(root,res){ ...
2026-01-27
0
8
题解 | 比较版本号
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 比较版本号 * @param version1 string字符串 * @param version2 string字符串 * @return int整型 */ function comp...
2026-01-27
0
7
题解 | 单链表的排序
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListN...
2026-01-27
0
7
题解 | 两个链表的第一个公共结点
/*function ListNode(x){ this.val = x; this.next = null; }*/ function FindFirstCommonNode(pHead1, pHead2) { // write code here while(pH...
2026-01-27
0
7
题解 | 链表中倒数最后k个结点
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param pHead List...
2026-01-27
0
6
题解 | 链表中环的入口结点
/*function ListNode(x){ this.val = x; this.next = null; }*/ function EntryNodeOfLoop(pHead) { // write code here let head=pHead; l...
2026-01-27
0
7
题解 | 判断链表中是否有环
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * * @param head ListNode类 * @return bool布尔型 */ function hasC...
2026-01-27
0
6
题解 | 合并k个已排序的链表
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param lists List...
2026-01-27
0
7
首页
上一页
1
2
下一页
末页