算法leecode
优价实习
开发工程师,各种求职技巧分享与你!
展开
-
二叉树前中后
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>D.原创 2021-03-19 13:04:02 · 123 阅读 · 0 评论 -
根据前序和中序构建二叉树
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>D.原创 2021-03-19 01:15:19 · 129 阅读 · 0 评论 -
数组两数之和求索引
/** * * @param numbers int整型一维数组 * @param target int整型 * @return int整型一维数组 */ function twoSum( numbers , target ) { if(numbers.length<=1){ return[] } let map = new Map() // 用于存放已出现过的的值和其下标 for(let i=0; i<numbers.原创 2021-03-19 00:17:15 · 182 阅读 · 0 评论 -
括号序列
/** * * @param s string字符串 * @return bool布尔型 */ function isValid(s) { if (s.length % 2) return false; // write code here const queue = []; const map = { ']': '[', ')': '(', '}': '{', }; const left = Ob.原创 2021-03-18 23:26:32 · 122 阅读 · 0 评论 -
LRu内存分配问题
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>D.原创 2021-03-18 22:43:39 · 116 阅读 · 0 评论 -
链表中的节点每k个一组翻转
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * * * @param head ListNode类 * @param k int整型 * @return ListNode类 */ function reverseKGroup(head, k) { // write code here //反转k为一组的链表反转 let pre = null.原创 2021-03-18 22:42:44 · 185 阅读 · 0 评论 -
链表中有环
/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * * @param head ListNode类 * @return bool布尔型 */ function hasCycle(head) { // write code here //如果为空,则无环 if (head == null) return false // 定义两个.原创 2021-03-18 22:42:01 · 133 阅读 · 0 评论 -
链表反转
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>D.原创 2021-03-18 22:40:53 · 82 阅读 · 0 评论
分享