一年一度的CareerCup刷题活动来了,今年活动形式大致与去年一样,题目原则上一天一道~ 视具体情况可以考虑加量~活动组织形式:1、一天一道,数量根据题目难度弹性变 ...
1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire rowand column are set to 0.请参加活动的童鞋跟帖回复自己的解法,回复请参考 ...
3.3 Imagine a (literal) stack of plates. If the stack gets too high, it might topple.Therefore, in real life, we would likely start a new stack when the previ ...
2.5 You have two numbers represented by a linked list, where each node contains asingle digit. The digits are stored in reverse order, such that the Ts digit ...
1.2 Implement a function void reverse(char* str) in C or C++ which reverses a nullterminated string.请参加活动的童鞋跟帖回复自己的解法,回复请参考以下格式: ...
2.1 Write code to remove duplicates from an unsorted linked list.FOLLOW UPHow would you solve this problem if a temporary buffer is not allowed?请参加活 ...
3.5 Implement a MyQueue class which implements a queue using two stacksNotice:1、记得在程序注释中表明自己算法的时间、空间复杂度2、代码难懂之处加注释 ...
1.3 Given two strings, write a method to decide if one is a permutation of the other.请参加活动的童鞋跟帖回复自己的解法,回复请参考以下格式:Notice: ...
3.4 In the classic problem of the Towers of Hanoi, you have 3 towers and N disks ofdifferent sizes which can slide onto any tower. The puzzle starts with disk ...
3.2 How would you design a stack which, in addition to push and pop, also has afunction min which returns the minimum element? Push, pop and min shouldall o ...
3.1 Describe how you could use a single array to implement three stacks.请参加活动的童鞋跟帖回复自己的解法,回复请参考以下格式:Notice:1、记得在 ...
2.7 Implement a function to check if a linked list is a palindrome请参加活动的童鞋跟帖回复自己的解法,回复请参考以下格式:Notice:1、记得在程序注释中 ...
2.6 Given a circular linked list, implement an algorithm which returns the node atthe beginning of the loop.DEFINITIONCircular linked list: A (corrupt) li ...
2.4 Write code to partition a linked list around a value x, such that all nodes less thanx come before all nodes greater than or equal to x.请参加活动的童 ...
2.2 Implement an algorithm to find the kth to last element of a singly linked list.请参加活动的童鞋跟帖回复自己的解法,回复请参考以下格式:Notice:1 ...
2.3 Implement an algorithm to delete a node in the middle of a singly linked list,given only access to that node.EXAMPLEInput: the node c from the linked ...
1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures.按照国内的时间,已经是30号 ...
1.4 Write a method to replace all spaces in a string with'%20'. You may assume thatthe string has sufficient space at the end of the string to hold the additi ...
1.6 Given an image represented by an NxN matrix, where each pixel in the image is4 bytes, write a method to rotate the image by 90 degrees. Can you do this in ...
1.5 Implement a method to perform basic string compression using the countsof repeated characters. For example, the string aabcccccaaa would becomea2blc5a3. ...