- 博客(12)
- 收藏
- 关注
原创 [LeetCode]150.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 expression.Some examples: ["2", "1",
2016-10-31 04:49:17 255
原创 [LeetCode]422. Valid Word Square
Given a sequence of words, check whether it forms a valid word square.A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k < max(numRow
2016-10-20 08:58:30 860
原创 [LeetCode]2. Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2016-10-19 11:04:45 198
原创 [LeetCode]94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recursive solu
2016-10-17 00:38:13 229
原创 [Hackrank]Get Node Value
You’re given the pointer to the head node of a linked list and a specific position. Counting backwards from the tail node of the linked list, get the value of the node at the given position. A positio
2016-10-16 09:31:12 385
原创 [LeetCode]170. Two Sum III - Data structure design
Design and implement a TwoSum class. It should support the following operations: add and find.add - Add the number to an internal data structure.find - Find if there exists any pair of numbers w
2016-10-08 11:10:43 355
原创 [LeetCode]230. Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if t
2016-10-08 03:52:09 240
原创 [LeetCode]1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums =
2016-10-07 03:39:25 282
原创 [LeetCode]100. Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.思路:这是一
2016-10-07 03:08:25 169
原创 [LeetCode]268. Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm sho
2016-10-06 00:20:37 229
原创 [LeetCode]225. Implement Stack using Queues
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whet
2016-10-05 03:52:38 284
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人