摘要: 1、题目描述 A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetc 阅读全文
posted @ 2018-04-03 20:13 山里的小勇子 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1、题目描述 经典的反转二叉树,就是将二叉树中每个节点的左、右儿子交换。 2、题目分析 3、代码 阅读全文
posted @ 2018-04-01 15:26 山里的小勇子 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1、题目描述 Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. 计算二叉树每一层的节点的数据域的平均值。 2、题目分析 使用广度优先遍 阅读全文
posted @ 2018-04-01 15:10 山里的小勇子 阅读(1092) 评论(0) 推荐(0) 编辑
摘要: 1、题目描述 Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). Yo 阅读全文
posted @ 2018-04-01 14:27 山里的小勇子 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 1、问题描述 Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime c 阅读全文
posted @ 2018-03-29 17:06 山里的小勇子 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 1、问题描述 Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it woul 阅读全文
posted @ 2018-03-29 15:57 山里的小勇子 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1、题目描述 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the far 阅读全文
posted @ 2018-03-29 14:26 山里的小勇子 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 1、问题描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a can 阅读全文
posted @ 2018-03-29 14:09 山里的小勇子 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1、问题描述 Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 - 阅读全文
posted @ 2018-03-29 12:53 山里的小勇子 阅读(3560) 评论(0) 推荐(0) 编辑
摘要: 1、问题描述 Reverse Vowels of a String Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = "hello", 阅读全文
posted @ 2018-03-29 10:37 山里的小勇子 阅读(418) 评论(0) 推荐(0) 编辑