码迷,mamicode.com
首页 >  
搜索关键字:cc150    ( 107个结果
2.6---找有环链表的开头结点(CC150)
public ListNode detectCycle(ListNode head) { ListNode fast = head; ListNode slow = head; int flag = 0; ListNode intersection = nu...
分类:其他好文   时间:2015-12-18 10:36:29    阅读次数:107
2.3---删除链表的结点,不提供头结点(CC150)
这里,注意如果是尾结点,那么无解。public class Solution {public void deleteNode(ListNode node) {//利用李代桃僵// // if(node.next == null)// // {// // node = null;//error: no...
分类:其他好文   时间:2015-12-18 00:06:32    阅读次数:191
2.5---链表来进行加法,链式A+B(CC150)
这里是用了自己的方法,和书本不一样。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
2.1---删除链表中重复元素(CC150)
分成两种,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
1.2---翻转字符串(CC150)
import java.util.*; public class Reverse { public String reverseString(String iniString) { // write code here StringBuffer tmp = new ...
分类:其他好文   时间:2015-12-16 19:33:11    阅读次数:132
1.8---字符串是否是旋转而成(CC150)
答案:利用了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
1.1---判断字符串是否所有字符都不相同(CC150)
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
1.5---字符串压缩(CC150)
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
1.4---字符串空格变成20%(CC150)
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
1.6---旋转二维数组,旋转图像像素,旋转矩阵,90度(CC150)
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
107条   上一页 1 2 3 4 5 ... 11 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!