- 博客(10)
- 资源 (12)
- 收藏
- 关注
原创 python wordcount练习
google python class上的练习一个是统计文件中每个单词出现次数的,注意在用for line in f获取每行的字符的时候,为了从该行字符中提取单独的单词需要用split()方法。sorted(iterable[, key][, reverse]) Return a new sorted list from the items in iterable.,sorte
2013-04-29 20:26:39 5469
原创 careercup2.4
careercup2.4You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1’s digit is at the head of the list. Wr
2013-04-27 21:17:09 579
原创 carrercup 2.5检测链表中的环的位置
Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.DEFINITIONCircular linked list: A (corrupt) linked list in which a node’s next pointer points t
2013-04-25 19:27:27 925
原创 C++问题集锦
慢慢积累吧。。问题1C++二维数组如何做参数参考自stackoverflow,假设函数类型为voidtemplatevoid func(int (&arr)[N][M]){ //函数具体内容}int arr[2][3]= { 1,2,3,4,5,6 }; func(arr);问题2:如何读取二进制文件
2013-04-22 21:32:01 1737
原创 careercup1.7
1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.写一个算法加入M*N矩阵中有一个元素为0,那么该元素对应的行和列的所有元素均设为0分析:如果直接循环二维数组,当该数组元素为0时,把对应的行和列的元素均设为0.这样有可能会遇到
2013-04-22 21:15:39 633
原创 careercup3.5用两个栈实现一个队列
3.5 Implement a MyQueue class which implements a queue using two stacks.分析Queue:first in first outstack:first in last out由于队列移除元素移除的是队尾元素,因此用栈s2保持队尾元素。两个栈栈s1中:最新的元素在最上面栈s2中:最旧的元素在最
2013-04-19 21:28:49 571
原创 carrercup9.3
Given a sorted array of n integers that has been rotated an unknown number of times, give an O(log n) algorithm that finds an element in the array. You may assume that the array was originally sorted
2013-04-16 21:58:14 574
原创 careercup8.4写出字符串的所有排列
8.4Write a method to compute all permutations of a string这题有需要注意的点在:这个字符串中可能有重复字符,因此需剔除重复排列用的递归的思想,首先第一次可以选择字符串中的任意一个字符,剔除重复的,char_set用于保存当前位可能出现的字符。flag用于控制是否出现重复字符循环中这一句prev_str=prev_str
2013-04-12 21:24:23 695
原创 careercup top 150判断字符串中字符是否唯一(字符不重复)
Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures选自careercup top 150 questions 1.1#include#includeusing namespac
2013-04-12 19:17:59 920
翻译 fortran do construct(do循环)
cite from Fortran 90 Handbook by Jeanne C. Adam,Walter S. Brainerd,Jeanne T. Martin,Brian T. Smith,Jerrold L. Wagener有两种形式的do构造:the block DO and the nonblock DO块化的do与非块化的do。非块化的do是为了与fortran
2013-04-08 17:16:12 3013
mysql-connector-java-5.1.7驱动
2009-07-17
运动会计分系统(c++,包括课程设计文档)
2009-07-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人