摘要:
Source Given a binary tree, return the inorder traversal of its nodes' values. Example Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2]. Challeng 阅读全文
摘要:
Source Given a binary tree, return the preorder traversal of its nodes' values. Note Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Example Ch 阅读全文
摘要:
Source Problem Remove all elements from a linked list of integers that have value val. Example Given 1->2->3->3->4->5->3, val = 3, you should return t 阅读全文
摘要:
Source Problem Given a linked list, swap every two adjacent nodes and return its head. Example Given 1->2->3->4, you should return the list as 2->1->4 阅读全文
摘要:
Source Problem Given a list, rotate the list to the right by k places, where k is non-negative. Example Given 1->2->3->4->5 and k = 2, return 4->5->1- 阅读全文
摘要:
Problem Statement Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. 阅读全文
摘要:
Source Implement an algorithm to delete a nodein the middle of a singly linked list, given only access to that node. Example Given 1->2->3->4, and nod 阅读全文
摘要:
Source Given a singly linked list of characters, write a function that returns true if the given list is palindrome, else false. 题解1 - 使用辅助栈 根据栈的特性(FI 阅读全文
摘要:
背景 最近在对接国内的外卖平台,代码啥的正常开发、测试、上线都没发现什么异常的。突然,最近有运维反馈说漏了单据,一开始我以为是外卖平台那边接口异常,拉单延迟导致的,就没怎么放在心上。过了半天,运维那边继续反馈此类问题,且最开始那个订单依旧没有同步,这个时候我看了接口响应都是正常的,但是JSON解析返 阅读全文
摘要:
Source Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially contains only the fir 阅读全文