public ListNode detectCycle(ListNode head) { ListNode fast = head; ListNode slow = head; int flag = 0; ListNode intersection = nu...
分类:
其他好文 时间:
2015-12-18 10:36:29
阅读次数:
107
这里,注意如果是尾结点,那么无解。public class Solution {public void deleteNode(ListNode node) {//利用李代桃僵// // if(node.next == null)// // {// // node = null;//error: no...
分类:
其他好文 时间:
2015-12-18 00:06:32
阅读次数:
191
这里是用了自己的方法,和书本不一样。import java.util.HashSet;import java.util.Set;class ListNode{ int val; ListNode next; ListNode(int x){ val = x; }...
分类:
其他好文 时间:
2015-12-18 00:00:48
阅读次数:
355
分成两种,1种开了额外空间,临时缓冲区,一种没有开import java.util.HashSet;import java.util.Set;class ListNode{ int data; ListNode next;}public class Solution{ public...
分类:
其他好文 时间:
2015-12-17 00:27:34
阅读次数:
156
import java.util.*; public class Reverse { public String reverseString(String iniString) { // write code here StringBuffer tmp = new ...
分类:
其他好文 时间:
2015-12-16 19:33:11
阅读次数:
132
答案:利用了XY , YX中第一个XYXY包含了第二个public class Solution{ public static void main(String[] args){ System.out.println(isRotation("abc","abc")); ...
分类:
其他好文 时间:
2015-12-16 19:05:37
阅读次数:
101
import java.util.*; public class Different { public boolean checkDifferent(String str) { // write code here for(int i = 0; i < str.le...
分类:
其他好文 时间:
2015-12-16 18:55:52
阅读次数:
126
import java.util.*; public class Zipper { public String zipString(String str) { // write code here if(str.length() == 0 ) return str; ...
分类:
其他好文 时间:
2015-12-16 18:55:10
阅读次数:
140
import CtCILibrary.AssortedMethods;public class Question { // Assume string has sufficient free space at the end public static void replaceSpace...
分类:
其他好文 时间:
2015-12-16 18:52:52
阅读次数:
163
import java.util.*; public class Transform { public int[][] transformImage(int[][] matrix, int n) { // write code here n = matrix....
分类:
编程语言 时间:
2015-12-16 18:52:38
阅读次数:
201