上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 44 下一页
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nodes its 阅读全文
posted @ 2019-10-31 23:58 自由之翼Az 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iterativel 阅读全文
posted @ 2019-10-31 23:32 自由之翼Az 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iterative 阅读全文
posted @ 2019-10-31 23:22 自由之翼Az 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort. Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (blac 阅读全文
posted @ 2019-10-30 23:29 自由之翼Az 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 阅读全文
posted @ 2019-10-30 22:05 自由之翼Az 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Example 2: NOTE: input types have been 阅读全文
posted @ 2019-10-29 23:17 自由之翼Az 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2019-10-28 23:28 自由之翼Az 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2019-10-28 23:08 自由之翼Az 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]。不能使用除法。 题解: 将每一行分为两半部分,0,1,2....i-1 与 i+1.....n-1这两 阅读全文
posted @ 2019-10-21 16:39 自由之翼Az 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 题目描述 写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。 题解: 使用位运算 1 class Solution { 2 public: 3 int Add(int num1, int num2){ 4 int sum, carry; 5 while (num2 != 阅读全文
posted @ 2019-10-20 23:01 自由之翼Az 阅读(97) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 44 下一页