摘要:
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−... 阅读全文
posted @ 2015-08-09 18:35
Sawyer Ford
阅读(178)评论(0)推荐(0)
摘要:
题目描述:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat",... 阅读全文
posted @ 2015-08-04 20:12
Sawyer Ford
阅读(201)评论(0)推荐(0)
摘要:
题目描述:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space? 这题思路就是把单链表的前半部分或后半部分反转,然后比较。s... 阅读全文
posted @ 2015-07-25 18:35
Sawyer Ford
阅读(190)评论(0)推荐(0)
摘要:
题目描述:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipe... 阅读全文
posted @ 2015-07-24 21:04
Sawyer Ford
阅读(213)评论(0)推荐(0)
摘要:
题目描述:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given s... 阅读全文
posted @ 2015-07-23 22:36
Sawyer Ford
阅读(165)评论(0)推荐(0)