![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
面试题
文章平均质量分 68
jjiang06
这个作者很懒,什么都没留下…
展开
-
[每天一题]判断字符串里否是都是独一无二的字符(不要用额外空间)
Implement an algorithm to determin if a string has all unique characters. What if you can not use additional data structures?首先,先实现用额外原创 2011-09-18 04:30:55 · 844 阅读 · 0 评论 -
[每天一题]删除字符串中的重复字符(不要使用额外空间)
Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer.NOTE: One or two addit原创 2011-09-18 06:00:00 · 900 阅读 · 0 评论 -
[每天一题]把所有的空格替换成‘%20’
Write a method to replace all spaces in a string with'%20'算法:1,计算出一个字符串里有多少个空格。(为方便计算出新字符串的长度)2,从后往前遍历一遍这个字符串,如果遇到空格,就存储‘%20’,如果不是空格,就原创 2011-09-19 04:51:45 · 1792 阅读 · 0 评论 -
[每天一题]如果M*N的矩阵中的一个元素为0,则设置其整个行列为0
Write an algorithm such that if an element in an M*N matrix is 0, its entire row and column is set to 0.分析:乍一看,很容易解决,就遍历一遍整个矩阵,每次见到0就把原创 2011-09-19 05:06:18 · 1155 阅读 · 1 评论 -
字符串翻转集合, case1, hello world->world hello; case2, hello world->olleh dlrow
Case1: 从hello world 翻转成 world hello/*大概的理念是先把所有字符串都翻转了,所以hello world 编程dlrow olleh. 然后再每个字符之间翻转,变成world hello(以空位为分界点)*/Case2: 从hello world翻转成olleh dlrow/*大概的理念是以空格为分界点,每个字符串之间翻转原创 2014-03-20 03:07:37 · 1336 阅读 · 0 评论