随笔分类 -  CareerCup

上一页 1 ··· 4 5 6 7 8
摘要: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 数... 阅读全文
posted @ 2015-07-19 12:02 Grandyang 阅读(1325) 评论(0) 推荐(0) 编辑
摘要: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?这道题让我们... 阅读全文
posted @ 2015-07-18 10:55 Grandyang 阅读(1415) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-07-17 06:52 Grandyang 阅读(1518) 评论(0) 推荐(0) 编辑
摘要: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 矩... 阅读全文
posted @ 2015-07-17 06:21 Grandyang 阅读(891) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2015-07-17 05:21 Grandyang 阅读(834) 评论(0) 推荐(0) 编辑
摘要:1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a... 阅读全文
posted @ 2015-07-17 03:49 Grandyang 阅读(4266) 评论(0) 推荐(0) 编辑
摘要: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 ... 阅读全文
posted @ 2015-07-16 11:41 Grandyang 阅读(1587) 评论(0) 推荐(0) 编辑
摘要:1.3 Given two strings, write a method to decide if one is a permutation of the other.这道题给定我们两个字符串,让我们判断一个是否为另一个的全排列字符串。在LeetCode中,关于排列的题有如下几道,Permutat... 阅读全文
posted @ 2015-07-16 08:47 Grandyang 阅读(1713) 评论(0) 推荐(0) 编辑
摘要:1.2 Implement a function void reverse(char *str) in C or C++ which reverses a null-terminated string.这道题让我们用C++或C语言来翻转一个字符串,不算一道难题,在之前那道Reverse Words ... 阅读全文
posted @ 2015-07-15 23:03 Grandyang 阅读(1026) 评论(0) 推荐(0) 编辑
摘要:1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structure?这道题让我们判断一个字符串中是否有重复的字符... 阅读全文
posted @ 2015-07-15 13:13 Grandyang 阅读(3047) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8
Fork me on GitHub