E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
CTCI
[google面试
CTCI
] 1-8.判断子字符串
【字符串与数组】Q:AssumeyouhaveamethodisSubstringwhichchecksifonewordisasubstringofanotherGiventwostrings,s1ands2,writecodetocheckifs2isarotationofs1usingonlyonecalltoisSubstring(ie,“waterbottle”isarotationof
·
2013-10-19 22:00
Google
[google面试
CTCI
] 1-7.将矩阵中特定行、列置0
【字符串与数组】Q:WriteanalgorithmsuchthatifanelementinanMxNmatrixis0,itsentirerowandcolumnissetto0.题目:写一个算法,如果一个MxN矩阵中某个元素为0,则将该元素所在的行、列都置为0.解答:方法一:错误的解法,思维误区。依次遍历二维数组(矩阵),遇到一个0,就将这个0所在的行和列全部置为0,咋看一下没问题,仔细一想
·
2013-10-19 22:00
Google
[google面试
CTCI
] 1-8.判断子字符串
【字符串与数组】Q:AssumeyouhaveamethodisSubstringwhichchecksifonewordisasubstringofanotherGiventwostrings,s1ands2,writecodetocheckifs2isarotationofs1usingonlyonecalltoisSubstring(ie,“waterbottle”isarotationof
JJDiaries
·
2013-10-19 11:16
google面试-CTCI
[google面试
CTCI
] 1-6.图像旋转问题
【字符串与数组】Q:GivenanimagerepresentedbyanNxNmatrix,whereeachpixelintheimageis4bytes,writeamethodtorotatetheimageby90degreesCanyoudothisinplace?题目:假定一幅图像能用NxN的矩阵表示,每个像素是四字节。写一个算法将图像旋转90度,你能否在原地进行操作(也即不分配额外
·
2013-10-19 11:00
Google
[google面试
CTCI
] 1-5.替换字符串中特定字符
【字符串与数组】Q:Writeamethodtoreplaceallspacesinastringwith‘%20’题目:写一个算法将一个字符串中的空格替换成%20解答:很直观的解法,首先统计出字符串中空格个数,然后分配新的内存空间,依次从头到尾复制原字符串到新字符串中,遇到空格,则复制%20这三个字符。还有没有其他更好点的方法呢??char*replace(char*str){ intlen=
·
2013-10-19 10:00
Google
[google面试
CTCI
] 1-4.判断两个字符串是否由相同字符组成
【字符串与数组】Q:Writeamethodtodecideiftwostringsareanagramsornot题目:写一个算法来判断两个字符串是否为换位字符串。(换位字符串是指组成字符串的字符相同,但位置不同)解答:方法一:假设为ascii2码字符串,那么可以分配两个256大小的int数组,每个数组用于统计一个字符串各个字符出现的次数,最后,比较这两个int数组,看是否每个元素都相同。时间复
·
2013-10-19 10:00
Google
[google面试
CTCI
]1-3.字符串去重
【字符串与数组】Q:DesignanalgorithmandwritecodetoremovetheduplicatecharactersinastringwithoutusinganyadditionalbufferNOTE:OneortwoadditionalvariablesarefineAnextracopyofthearrayisnotFOLLOWUPWritethetestcasesf
JJDiaries
·
2013-10-19 10:09
google面试-CTCI
[google面试
CTCI
]1-3.字符串去重
【字符串与数组】Q:DesignanalgorithmandwritecodetoremovetheduplicatecharactersinastringwithoutusinganyadditionalbufferNOTE:OneortwoadditionalvariablesarefineAnextracopyofthearrayisnotFOLLOWUPWritethetestcasesf
·
2013-10-19 09:00
Google
Cracking the coding interview--问题与解答
作者:Hawstein出处:http://hawstein.com/posts/
ctci
-solutions-contents.html声明:本文采用以下协议进行授权: 自由转载-非商用-非衍生-保持署名
overstack
·
2013-10-09 19:00
code
面试题
the
Cracking
技术面试圣经《Cracking the Coding Interview》题解C++版
http://hawstein.com/posts/
ctci
-solutions-contents.html
dong_007_007
·
2013-08-27 18:00
上一页
1
2
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他