上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页
摘要: 平衡二叉树public class BinaryTree { public Node root; /** * 内部类实现结点类,可提高安全性 * */ static class Node{ int data; Node ... 阅读全文
posted @ 2015-08-20 12:04 疾风剑 阅读(220) 评论(0) 推荐(0) 编辑
摘要: package com.example.mydemo;import java.util.List;import android.app.Activity;import android.app.ActionBar;import android.app.Fragment;import android.c... 阅读全文
posted @ 2015-07-26 10:32 疾风剑 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 重建二叉树:题目描述输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。class TreeNode { in... 阅读全文
posted @ 2015-07-07 11:49 疾风剑 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Set接口Set不允许包含相同的元素,如果试图把两个相同元素加入同一个集合中,add方法返回false。Set判断两个对象相同不是使用==运算符,而是根据equals方法。也就是说,只要两个对象用equals方法比较返回true,Set就不 会接受这两个对象。HashSetHashSet有以下特点... 阅读全文
posted @ 2015-06-27 22:36 疾风剑 阅读(234) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-06-26 00:20 疾风剑 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding eleme... 阅读全文
posted @ 2015-06-24 22:03 疾风剑 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目:判断一个数是不是回文数Determine whether an integer is a palindrome. Do this without extra space.思路:借助上一道求整数逆序的思路,判断逆序后的数和原数是否相等就行。要注意,负数都不是回文数11506 / 11506 te... 阅读全文
posted @ 2015-06-23 17:32 疾风剑 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321思路:递归解答:1032 / 1032 test cases passed.Status: AcceptedRunt... 阅读全文
posted @ 2015-06-23 16:59 疾风剑 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed fo... 阅读全文
posted @ 2015-06-23 11:31 疾风剑 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes... 阅读全文
posted @ 2015-06-20 21:44 疾风剑 阅读(148) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页