码迷,mamicode.com
首页 >  
搜索关键字:cc150    ( 107个结果
1.7---将矩阵元素为0的行列清零0(CC150)
答案:import java.util.ArrayList;import java.util.List;public class Solution{ public static void main(String[] args){ int[][] matix = {{1,2},{0...
分类:其他好文   时间:2015-12-16 18:49:20    阅读次数:119
11-10 CC150第一章
题目:1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? ________________...
分类:其他好文   时间:2015-11-10 13:49:12    阅读次数:218
CC150-链表4
给定两个用链表表示的证书,每个节点包含一个数位,反向存放,也就是个位排在链表首部并返回结果迭代:1.增加一个ArrayList数据结构用来临时保存每一位的加和结果2.之后分别遍历L1和L2两个链表将两个链表中的值相加3.将多出的位数加入ArrayList之后反向输出。递归: public stati...
分类:其他好文   时间:2015-08-20 06:44:52    阅读次数:120
CC150-链表3
实现一个算法删除链表中的某个结点,假定你只能访问这个这结点:输入:单向链表a->b->c->d->e中的结点c结果:不返回任何数据,但是该链表变为a->b->d->e分析:当结点为空或者是尾结点的时候,该算法实现不了。定义一个临时的next指针指向要删除结点的后续,n的data移动到next的dat...
分类:其他好文   时间:2015-08-19 07:03:37    阅读次数:135
CC150相关问题
18.9 动态计算中位数利用两个堆:一个最大堆,存放小于中位数的值;一个最小堆,存放大于中位数的值。则两个堆的堆顶即为数组中最中间的两个数。在插入新元素的时候,我们只要维护两个堆, 使其堆中元素的数量差别不超过1即可。ref refref: hawstein
分类:其他好文   时间:2015-08-18 15:49:21    阅读次数:123
CC150 - 链表
1. 移除未排序链表中的重复节点:方法1:利用哈希表:遍历一次,将所有元素的记录在哈希表中,利用哈希表记录节点是否重复代码:public static void deleteDup(LinkListNode n){ HashMap map = new HashMap(); LinkLis...
分类:其他好文   时间:2015-08-18 06:28:09    阅读次数:115
CC150-Array and String 1.3
problem:Given two string, write a method to decide if one is a permutation of the otherSolution:1. sort two strings and return weather str1 equal to s...
分类:其他好文   时间:2015-08-15 06:45:36    阅读次数:139
CC150-Array and string 1.2
problem:Implement a function void reverse(char *str) in C and C++ which reverse a null-terminated string.The solution:1. use another pointer end point...
分类:其他好文   时间:2015-08-15 06:42:04    阅读次数:147
CC150-Array and string 1.1
Promble:Implement an algorithm to determine if a string has all unique characters. What if you cannot use addtional data structure?My solution:1.ckeck...
分类:其他好文   时间:2015-08-15 01:29:27    阅读次数:106
cc150 Chapter 2 | Linked Lists 2.6 Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.
2.6Given a circular linked list,implement an algorithm which returns the node at the beginning of the loop. 快指针和慢指针一起在头指针开始移动,快指针每次移动两步,慢指针每次移动一步,直到相遇...
分类:其他好文   时间:2015-05-10 15:36:48    阅读次数:125
107条   上一页 1 2 3 4 5 6 ... 11 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!