上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页
摘要: 题目: Given a binary tree, find its minimum depth. 给定二叉树,找到它的最小深度。 The minimum depth is the number of nodes along the shortest path from the root node d 阅读全文
posted @ 2018-09-10 22:14 chan_ai_chao 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题目: Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct elem 阅读全文
posted @ 2018-09-10 20:08 chan_ai_chao 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a singly linked list, determine if it is a palindrome. 给出一个单链表,确定它是否是回文。 Example 1: Example 2: Follow up:Could you do it in O(n) time and O( 阅读全文
posted @ 2018-09-10 14:58 chan_ai_chao 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目: Remove all elements from a linked list of integers that have value val. 从具有值val的整数的链接列表中删除所有元素。 Example: 解答: 详解: 设置虚拟头结点dummyHead,dummyHead.next=h 阅读全文
posted @ 2018-09-09 15:48 chan_ai_chao 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. 给定一个字符串s和一个非空字符串p,找到s中p的变位词的所有起始索引。 Strings consists o 阅读全文
posted @ 2018-09-09 15:19 chan_ai_chao 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. 给定一个只包含字符'(',')','{','}','[ 阅读全文
posted @ 2018-09-09 11:34 chan_ai_chao 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目: A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum 阅读全文
posted @ 2018-09-08 13:00 chan_ai_chao 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a linked list, determine if it has a cycle in it. 给定一个链表,确定它是否有一个循环。 Follow up:Can you solve it without using extra space? 你能不用额外的空间解决它吗? 解答 阅读全文
posted @ 2018-09-08 12:12 chan_ai_chao 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目: Design a HashSet without using any built-in hash table libraries. 在不使用任何内置哈希表库的情况下设计HashSet。 To be specific, your design should include these func 阅读全文
posted @ 2018-09-08 11:53 chan_ai_chao 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two strings s and t, determine if they are isomorphic. 给定两个字符串s和t,确定它们是否是同构的。 Two strings are isomorphic if the characters in s can be repla 阅读全文
posted @ 2018-09-08 10:18 chan_ai_chao 阅读(402) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页