java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location at java.awt.Component.getLocationOnScreen_N...
The quesiton:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in...
分类:
其他好文 时间:
2014-12-30 11:23:11
阅读次数:
176
The questions:Determine whether an integer is a palindrome. Do this without extra space.Analysis:To determine whether an integer is a palindrome, we c...
分类:
其他好文 时间:
2014-12-30 01:41:54
阅读次数:
208
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
利用快慢指针
/**
* Definition for singly-linked list.
* class ListNode {
* int v...
分类:
其他好文 时间:
2014-12-29 21:35:23
阅读次数:
235
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-12-29 13:42:53
阅读次数:
158
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42218839
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees o...
分类:
其他好文 时间:
2014-12-29 09:03:54
阅读次数:
134
【题目】
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the nod...
分类:
其他好文 时间:
2014-12-27 17:34:02
阅读次数:
236
matlab函数_连通区域1、 matlab函数bwareaopen──删除小面积对象格式:BW2 = bwareaopen(BW,P,conn)作用:删除二值图像BW中面积小于P的对象,默认情况下使用8邻域。算法:(1)Determine the connected components. L =...
分类:
其他好文 时间:
2014-12-26 22:55:31
阅读次数:
175
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
题目的意思是判断链表中有没有环
思路:
定义两个指针,一个慢指针,一个快指针,慢指针一次走两步,快指针一次走一步,如果有环,那么慢、快指针一...
分类:
其他好文 时间:
2014-12-26 20:20:32
阅读次数:
191
很久之前刷的CTCI的题目,都快忘记了,做个分类汇总,再重新好好复习一遍。
Chapter 1 | Arrays and Strings
1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional
data stru...
分类:
其他好文 时间:
2014-12-26 20:20:00
阅读次数:
452