随笔分类 - CareerCup
摘要:2.2 Implement an algorithm to find the kth to last element of a singly linked list.这道题让我们求链表中倒数第k个元素,LeetCode中相类似的题目有Kth Largest Element in an Array 数...
阅读全文
摘要: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?这道题让我们...
阅读全文
摘要:1.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 i...
阅读全文
摘要:1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.LeetCode中的原题,请参见我之前的博客Set Matrix Zeroes 矩...
阅读全文
摘要:1.6 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 d...
阅读全文
摘要:1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a...
阅读全文
摘要:1.4 Write a method to replace all spaces in a string with '%20'. You may assume that the string has sufficient space at the end of the string to hold ...
阅读全文
摘要:1.3 Given two strings, write a method to decide if one is a permutation of the other.这道题给定我们两个字符串,让我们判断一个是否为另一个的全排列字符串。在LeetCode中,关于排列的题有如下几道,Permutat...
阅读全文
摘要:1.2 Implement a function void reverse(char *str) in C or C++ which reverses a null-terminated string.这道题让我们用C++或C语言来翻转一个字符串,不算一道难题,在之前那道Reverse Words ...
阅读全文
摘要:1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structure?这道题让我们判断一个字符串中是否有重复的字符...
阅读全文