LeetCode Online Judge
文章平均质量分 69
ZHANGTAOZAQaq
这个作者很懒,什么都没留下…
展开
-
Evaluate Reverse Polish Notation
import java.util.Scanner;import java.util.Stack;public class Solution {public static int evalRPN(String[] tokens) {String op3="+-*/";Stack num= new Stack();int result=0;int index=0;int原创 2014-05-04 18:59:00 · 352 阅读 · 0 评论 -
Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f原创 2014-08-13 20:51:17 · 510 阅读 · 0 评论 -
Same Tree LeetCode
https://oj.leetcode.com/problems/same-tree/原创 2014-08-13 11:05:27 · 390 阅读 · 0 评论 -
Sort List LeetCode
题目链接:点击打开链接原创 2014-08-11 20:15:03 · 403 阅读 · 0 评论 -
Reorder List LeetCode
LeetCode :Reorder List原创 2014-08-10 12:38:53 · 362 阅读 · 0 评论 -
Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?在一个单链表中找到you原创 2014-06-01 14:09:05 · 497 阅读 · 0 评论 -
判断单链表是否有环
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?原创 2014-06-01 00:02:36 · 511 阅读 · 0 评论 -
非递归遍历二叉树
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].题目原创 2014-05-31 22:33:37 · 466 阅读 · 0 评论 -
LeetCode-----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 example, givens = "leetcode",dic原创 2014-06-21 21:33:08 · 453 阅读 · 0 评论 -
Binary Tree Level Order Traversal
题目描述:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \原创 2014-06-28 14:20:04 · 391 阅读 · 0 评论 -
Populating Next Right Pointers in Each Node
题目地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/;原创 2014-06-22 12:47:49 · 468 阅读 · 0 评论 -
Sqrt(x)
牛顿迭代法 计算x2 = n的解,令f(x)=x2-n,相当于求解f(x)=0的解,如左图所示。 首先取x0,如果x0不是解,做一个经过(x0,f(x原创 2014-05-04 20:13:06 · 506 阅读 · 0 评论 -
Fraction to Recurring Decimal leetcode
leetcode原创 2014-12-23 17:19:17 · 411 阅读 · 0 评论