- 博客(7)
- 资源 (4)
- 收藏
- 关注
原创 CareerCup2.3 删除最中间那个,或者删除给出任意一个节点(只能得到这个节点的pointer)
/*Implement an algorithm to delete a node in the middle of a single linked list, given only access to that node.EXAMPLEInput: the node ‘c’ from the linked list a->b->c->d->eResult: nothing is retu
2012-05-01 10:40:24
514
原创 CareerCup 2.2 C++
//Implement an algorithm to find the nth to last element of a singly linked list /*Iteration Vs. RecursionIf a recursive method is called with a base case, the method returns a result. If a
2012-04-28 10:08:01
504
原创 careerCup1.8
/*Assume you have a method isSubstring which checks if one word is a substring of another Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to isSubstr
2012-04-25 10:37:58
518
原创 careerCup1.7
// Write an algorithm such that if an element in an MxN matrix is 0, its entire row and// column is set to 0 //相乘,如果该row或者该column为0,则set该row或column为0#include "iostream"#define M 5#defin
2012-04-24 16:25:38
415
原创 careerCup1.6(没有do in place)
//Given an image represented by an NxN matrix, where each pixel in the image is 4 //bytes, write a method to rotate the image by 90 degrees Can you do this in place?//int 4 byte!!!#incl
2012-04-23 09:51:21
398
原创 CareerCup1.5
//Write a method to replace all spaces in a string with '%20'#include#includeusing namespace std;void replaceSpace(string &s1){ int j=0,i=0; //find how many spaces are there in this str
2012-04-20 15:09:28
536
原创 CareerCup 1.4
//Write a method to decide if two strings are anagrams or not #include#include#define TRUE 1;#define FALSE 0;using namespace std;string sort(string &s1){//bubblefor(int i
2012-04-19 10:22:52
493
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人