上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页

2018年1月12日

回文序列(网易)

摘要: 题目描述 如果一个数字序列逆置之后跟原序列是一样的就称这样的数字序列为回文序列。例如:{1, 2, 1}, {15, 78, 78, 15} , {112} 是回文序列, {1, 2, 2}, {15, 78, 87, 51} ,{112, 2, 11} 不是回文序列。现在给出一个数字序列,允许使用 阅读全文

posted @ 2018-01-12 16:55 夜的第八章 阅读(260) 评论(0) 推荐(0) 编辑

Word Break(动态规划)

摘要: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For e 阅读全文

posted @ 2018-01-12 16:15 夜的第八章 阅读(197) 评论(0) 推荐(0) 编辑

Sum Root to Leaf Numbers

摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文

posted @ 2018-01-12 13:08 夜的第八章 阅读(89) 评论(0) 推荐(0) 编辑

Evaluate Reverse Polish Notation

摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文

posted @ 2018-01-12 10:23 夜的第八章 阅读(106) 评论(0) 推荐(0) 编辑

2018年1月11日

Palindrome Partitioning

摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl 阅读全文

posted @ 2018-01-11 16:18 夜的第八章 阅读(102) 评论(0) 推荐(0) 编辑

triangle

摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文

posted @ 2018-01-11 14:58 夜的第八章 阅读(142) 评论(0) 推荐(0) 编辑

Populating Next Right Pointers in Each Node(I and II)

摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文

posted @ 2018-01-11 10:10 夜的第八章 阅读(96) 评论(0) 推荐(0) 编辑

2018年1月10日

分苹果(网易)

摘要: 题目描述 n 只奶牛坐在一排,每个奶牛拥有 ai 个苹果,现在你要在它们之间转移苹果,使得最后所有奶牛拥有的苹果数都相同,每一次,你只能从一只奶牛身上拿走恰好两个苹果到另一个奶牛上,问最少需要移动多少次可以平分苹果,如果方案不存在输出 -1。 输入描述: 每个输入包含一个测试用例。每个测试用例的第一 阅读全文

posted @ 2018-01-10 19:52 夜的第八章 阅读(164) 评论(0) 推荐(0) 编辑

Flatten Binary Tree to Linked List

摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: Hints: If you notice carefully in th 阅读全文

posted @ 2018-01-10 17:13 夜的第八章 阅读(102) 评论(0) 推荐(0) 编辑

Construct Binary Tree from Inorder and Postorder Traversal(根据中序遍历和后序遍历构建二叉树)

摘要: 根据中序和后续遍历构建二叉树。 阅读全文

posted @ 2018-01-10 15:28 夜的第八章 阅读(96) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页

导航