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
Cracking
cracking
the coding interview No1.7
1.7 Write an algorithm such that if an element in an M*N matrix is 0,its entire row and column are set to 0;Answer:voidfunction(intmatrix[][],intm,intn) { if(matrix==NULL) return; inti,j,k; introw[m],
hnuzengchao
·
2014-10-19 16:00
cracking
the coding interview No1.6
1.6 Given an image represented by an N*N matrix,where each pixel in the image is 4 bytes,writea method to rotate the image by 90 degrees. Can you do this in place?Answer:顺时针旋转voidrotation(intmatrix[][
hnuzengchao
·
2014-10-19 16:00
cracking
the coding interview No1.5
1.5 Implement a method to perform basic string compression using the counts of repeated characters.For example. For example,the string aabcccccaaa would become a2b1c5a3.If the “compressed”string would
hnuzengchao
·
2014-10-19 16:00
cracking
the coding interview No1.4
1.4Write a method to replace all spaces in a string with’%20’,You may assume that the string has sufficient spaceat the end of the string to hold the additional characters,and that you are given the “
hnuzengchao
·
2014-10-19 16:00
cracking
the coding interview No1.3
1.3 Given two strings,write a method to decide if one is permutation of the other.//(1)O(nlogn)排序后比较字符串 //(2)O(n)hashtable boolisAnagram(strings1,strings2) { if(s1==NULL||s2==NULL) { returnfalse; } if
hnuzengchao
·
2014-10-19 15:00
cracking
the coding interview 中文版 (程序员面试金典)
转自:CTCI面试系列——谷歌面试官经典作品|快课网谷歌面试官经典作品(CTCI)目录1.1判断一个字符串中的字符是否唯一1.2字符串翻转1.3去除字符串中重复字符1.8利用已知函数判断字符串是否为另一字符串的子串2.1从链表中移除重复结点2.2实现一个算法从一个单链表中返回倒数第n个元素2.3给定链表中间某结点指针,删除链表中该结点2.4求由两个链表结点组成的数之和2.5给定一个循环链表,实
hnuzengchao
·
2014-10-19 11:00
cracking
the coding interview 中文版 (程序员面试金典)
转自:CTCI面试系列——谷歌面试官经典作品|快课网谷歌面试官经典作品(CTCI)目录1.1判断一个字符串中的字符是否唯一1.2字符串翻转1.3去除字符串中重复字符1.8利用已知函数判断字符串是否为另一字符串的子串2.1从链表中移除重复结点2.2实现一个算法从一个单链表中返回倒数第n个元素2.3给定链表中间某结点指针,删除链表中该结点2.4求由两个链表结点组成的数之和2.5给定一个循环链表,实
hackerzchao
·
2014-10-19 11:00
cracking
the
coding
interview
cracking
the coding interview No1.2
1.2Implement a function vod reverse(char *str)in C or C++which reverses a null-terminated string.voidreverse(char*str) { if(str==NULL) return; char*str1=str; intlength=0; while(*str1!='\0') { lengt
hnuzengchao
·
2014-10-19 11:00
cracking
the coding interview No1.1
1.1 Implement an algorithm to determine if a string has all unique characters. Whatifyoucannnotuseadditionaldatastructures?boolisUnique(char*str) { inthash[256]; memset(hash,0,sizeof(hash)); if(str
hnuzengchao
·
2014-10-19 10:00
【转】Aircrack-ng Suite Cheatsheet
security-tools/aircrack-ng-suite-cheatsheet/ Setting TX POWER iw reg set BO iwconfig wlan1 txpower 25
Cracking
j4s0nh4ck
·
2014-09-03 22:00
rack
暴力枚举 + 24点 --- hnu :
Cracking
the Safe
Cracking
the Safe Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB
·
2014-08-10 21:00
rack
Cracking
the coding interview(中文版)
转自:CTCI面试系列——谷歌面试官经典作品|快课网谷歌面试官经典作品(CTCI)目录1.1判断一个字符串中的字符是否唯一1.2字符串翻转1.3去除字符串中重复字符1.8利用已知函数判断字符串是否为另一字符串的子串2.1从链表中移除重复结点2.2实现一个算法从一个单链表中返回倒数第n个元素2.3给定链表中间某结点指针,删除链表中该结点2.4求由两个链表结点组成的数之和2.5给定一个循环链表,实现一
u012564690
·
2014-07-01 11:00
CTCI
喧闹中坚守底线-徘徊的行走在不知道路在何方的大地上。
书籍:《
cracking
the
·
2014-05-16 14:00
基础知识(给要找工作的)
1.数据结构与算法1.1书籍(1)算法导论(2)编程之美(3)编程珠玑(4)数据结构(C语言版)(5)CareerCup.
Cracking
.the.Technical.Interview.Ed4.2010
颜建海
·
2014-05-14 17:00
Cracking
the coding interview
CareerCup目录Chapter1|ArraysandStrings1.1 Implementanalgorithmtodetermineifastringhasalluniquecharacters.Whatifyoucannotuseadditionaldatastructures?1.2 WritecodetoreverseaC-StyleString.(C-Stringmeanstha
SunnyYoona
·
2014-05-05 11:00
面试
校园招聘
Careercup
剑指offer
Cracking
the coding interview--Q19.8
题目原文:Designamethodtofindthefrequencyofoccurrencesofanygivenwordinabook.译文:设计一个方法找到给定单词在一本书中的出现次数。解答若只是查询一次,先进行预处理,事先处理好,放在一个Hashtable里,在通过O(1)的时间进行查询即可。代码如下:classQ19_8{ publicstaticvoidmain(String[]ar
Mars_NAVY
·
2014-04-17 17:00
relearn
Cracking
the coding interview--Q19.7
题目原文:Youaregivenanarrayofintegers(bothpositiveandnegative).Findthecontinuoussequencewiththelargestsum.Returnthesum.EXAMPLEInput:{2,-8,3,-2,4,-10}Output:5(i.e.,{3,-2,4})译文:给出一个整型数组(包括正负数),找出和最大的子序列,并返回
Mars_NAVY
·
2014-04-17 16:00
relearn
Cracking
the coding interview--Q19.6
题目原文:Givenanintegerbetween0and999,999,printanEnglishphrasethatdescribestheinteger(eg,“OneThousand,TwoHundredandThirtyFour”).译文:给一个0到999,999的整型,打印一个英文描述的整型(如:“OneThousand,TwoHundredandThirtyFour”)解答首先将
Mars_NAVY
·
2014-04-15 20:00
Cracking
the coding interview--Q19.5
题目原文:TheGameofMasterMindisplayedasfollows:Thecomputerhasfourslotscontainingballsthatarered(R),yellow(Y),green(G)orblue(B).Forexample,thecomputermighthaveRGGB(e.g.,Slot#1isred,Slots#2and#3aregreen,Slot
Mars_NAVY
·
2014-04-15 11:00
Cracking
the coding interview--Q19.4
题目原文:Writeamethodwhichfindsthemaximumoftwonumbers.Youshouldnotuseif-elseoranyothercomparisonoperator.EXAMPLEInput:5,10Output:10译文:写一个方法找出两个数的最大值,你不应该使用if-else或者任何其他比较操作。例如输入:5,10输出:10解答我们可以通过一步步的分析来将需
Mars_NAVY
·
2014-04-10 10:00
Cracking
the coding interview--Q19.3
题目原文:Writeanalgorithmwhichcomputesthenumberoftrailingzerosinnfactorial.译文:写一个算法计算n的阶乘的尾数的零的个数。解答首先,算出n的阶乘的结果再去计算末尾有多少个0这种方法是不可取的,因为n的阶乘是一个非常大的数,分分种就会溢出。我们应当去分析,是什么使n的阶乘结果末尾出现0。n阶乘末尾的0来自因子5和2相乘,5*2=10。
Mars_NAVY
·
2014-04-09 16:00
Cracking
The Coding Interview2.4
删除前面的linklist,使用node来表示链表//Youhavetwonumbersrepresentedbyalinkedlist,whereeachnodecontainsasingledigit.Thedigitsarestoredinreverseorder,suchthatthe1’sdigitisattheheadofthelist.Writeafunctionthataddsth
shenlan282
·
2014-04-09 13:00
Cracking
The Coding Interview2.3
#include #include usingnamespacestd; classlinklist { private: classnode { public: node(){} stringdata; node*next; }; intsize; public: node*head; linklist() { head=newnode; size=0; } /***整表创建***/ voi
shenlan282
·
2014-04-08 22:00
Cracking
the Coding Interview Q1.4
MySolution:package chapter1; /** * Write a method to replace all spaces in a string with ‘%20’. (Assume string * has sufficient free space at the end) * * @author jd * */ public class Q1_4 {
jdflyfly
·
2014-04-08 21:00
Cracking
The Coding Interview 2.2
#include #include usingnamespacestd; classlinklist { private: classnode { public: node(){} stringdata; node*next; }; node*head; intsize; public: linklist() { head=newnode; size=0; } /***整表创建***/ voidC
shenlan282
·
2014-04-08 21:00
Cracking
the Coding Interview Q1.3
MySolution:package chapter1; /** * Write a method to decide if two strings are anagrams or not. * * @author jd * */ public class Q1_3 { /** * Assume the char set is extended ASCII, we
jdflyfly
·
2014-04-08 21:00
Cracking
the Coding Interview Q1.2
MySolution:#include #include /** * reverse the string in place. */ void reverse(char* str) { if (str == NULL) return; int n = strlen(str); char tmp; //be careful: i
jdflyfly
·
2014-04-08 20:00
Cracking
the Coding Interview Q1.1
MySolution: package chapter1; /** * Implement an algorithm to determine if a string has all unique characters. * What if you can not use additional data structures? * * @author jd * */ public
jdflyfly
·
2014-04-08 20:00
Cracking
the coding interview--Q19.2
题目原文:Designanalgorithmtofigureoutifsomeonehaswoninagameoftic-tac-toe.译文:设计一个算法判断某人是否赢了“井”字游戏。解答若只是要知道一个或少个井字的格局,只要直接遍历判断行列和对角线是否相同,然后返回赢家即可,代码如下:classQ19_2{ publicstaticvoidmain(String[]args){ char[][
Mars_NAVY
·
2014-04-08 16:00
Cracking
The Coding Interview 2.0 单链表
#include #include usingnamespacestd; classlinklist { private: classnode { public: node(){} stringdata; node*next; }; node*first; intsize; public: linklist() { first=newnode; size=0; } /***整表创建***/ voi
shenlan282
·
2014-04-08 11:00
Cracking
the coding interview--Q19.1
题目原文:Writeafunctiontoswapanumberinplacewithouttemporaryvariables.译文:写一个函数交换两个数,并且不能使用临时变量。解答交换函数swap是经常用到的函数,小巧简单,以下两种实现方式都不需要使用临时变量://实现1voidswap(int&a,int&b){b=a-b;a=a-b;b=a+b;}//实现2voidswap(int&a,i
Mars_NAVY
·
2014-04-07 09:00
relearn
Cracking
the coding interview--Q18.6
题目原文:YouaregivenaclasswithsynchronizedmethodA,andanormalmethodC.Ifyouhavetwothreadsinoneinstanceofaprogram,cantheycallAatthesametime?CantheycallAandCatthesametime?译文:提供你一个含有同步方法A和普通方法C的类,如果你在程序的实例化中有两
Mars_NAVY
·
2014-04-06 09:00
Cracking
the coding interview--Q18.5
题目原文:Supposewehavethefollowingcode:classFoo{public:A(.....);/*IfAiscalled,anewthreadwillbecreatedand*thecorrespondingfunctionwillbeexecuted.*/B(.....);/*sameasabove*/C(.....);/*sameasabove*/}Foof;f.A(
Mars_NAVY
·
2014-04-05 10:00
Cracking
the coding interview--Q18.4
题目原文:Designaclasswhichprovidesalockonlyiftherearenopossibledeadlocks.译文:设计一个提供锁但不可能发生死锁的类。解答原书解答:classMyThreadextendsThread{ longtime; ArrayListres=newArrayList(); publicArrayListgetRes(){returnres;}
Mars_NAVY
·
2014-04-04 09:00
Cracking
the coding interview--Q18.3
题目原文:Implementasingletondesignpatternasatemplatesuchthat,foranygivenclassFoo,youcancallSingleton::instance()andgetapointertoaninstanceofasingletonoftypeFoo.AssumetheexistenceofaclassLockwhichhasacquir
Mars_NAVY
·
2014-04-03 22:00
Cracking
the coding interview--Q18.2
题目原文:Howcanyoumeasurethetimespentinacontextswitch?译文:怎样计算上下文切换的时间?解答上下文切换(有时也称为进程切换或任务切换)是指CPU的控制权从一个进程或线程切换到另一个。引起上下文切换的原因有哪些?时间片用完,CPU正常调度下一个任务;被其他优先级更高的任务抢占;执行任务碰到IO阻塞,调度器挂起当前任务,切换执行下一个任务;用户代码主动挂起当
Mars_NAVY
·
2014-04-03 17:00
Cracking
the coding interview--Q18.1
题目原文:What’sthedifferencebetweenathreadandaprocess?译文:线程与进程之间有什么不同?解答简言之,线程与进程的区别是:一个程序至少有一个进程,一个进程至少有一个线程;详细点,进程和线程的主要差别在于它们是不同的操作系统资源管理方式。进程有独立的地址空间,一个进程崩溃后,在保护模式下不会对其它进程产生影响,而线程只是一个进程中的不同执行路径。线程有自己的
Mars_NAVY
·
2014-04-03 17:00
Cracking
the coding interview--Q17.5
题目原文:WhatarethedifferencesbetweenTCPandUDP?ExplainhowTCPhandlesreliabledelivery(explainACKmechanism),flowcontrol(explainTCPsebnder’s/receiver’swindow)andcongestioncontrol.译文:TCP与UDP之间有什么不同?解释TCP怎样如何处理
Mars_NAVY
·
2014-04-03 16:00
Cracking
the coding interview--Q17.4
题目原文:Whatisanetwork/subnetmask?ExplainhowhostAsendsamessage/packettohostBwhen:(a)bothareonsamenetworkand(b)bothareondifferentnetworks.Explainwhichlayermakestheroutingdecisionandhow.译文:网络/子网掩码是什么?解释主机A
Mars_NAVY
·
2014-04-03 16:00
Cracking
The Coding Interview 1.8
//AssumeyouhaveamethodisSubstringwhichchecksifonewordisasubstringofanother. //Giventwostrings,s1ands2,writecodetocheckifs2isarotationofs1usingonlyonecalltoisSubstring //(i.e.,“waterbottle”isarotationo
shenlan282
·
2014-04-03 12:00
Cracking
The Coding Interview 1.7
//WriteanalgorithmsuchthatifanelementinanMxNmatrixis0,itsentirerowandcolumnissetto0. // //这题原答案就是要两个buffer来记录出现0的位置。不知道有没可以不用buffer的方法。 #include usingnamespacestd; voidsetZero(int**matrix,intm,intn)
shenlan282
·
2014-04-03 10:00
Cracking
The Coding Interview 1.6
//原文: // //GivenanimagerepresentedbyanNxNmatrix,whereeachpixelintheimageis4bytes,writeamethodtorotatetheimageby90degrees.Canyoudothisinplace? // //先转置在上下交换 #include usingnamespacestd; voidswap(int&a,
shenlan282
·
2014-04-03 09:00
Cracking
The Coding Interview 1.5
//原文: // //Writeamethodtoreplaceallspacesinastringwith‘%20’. // #include usingnamespacestd; char*replace(char*str) { if(str==NULL) { returnNULL; } intsize=strlen(str); char*tem=newchar[size+1]; inti=0
shenlan282
·
2014-04-02 15:00
Cracking
the coding interview--Q17.3
题目原文:CompareandcontrasttheIPv4andIPv6protocols.译文:对比下IPv4和IPv6协议。解答什么是IPv4? 目前的全球因特网所采用的协议族是TCP/IP协议族。IP是TCP/IP协议族中网络层的协议,是TCP/IP协议族的核心协议。目前IP协议的版本号是4(简称为IPv4),发展至今已经使用了30多年。 IPv4的地址位数为32位,也就是最多
Mars_NAVY
·
2014-04-01 21:00
Cracking
The Coding Interview 1.4
//Writeamethodtodecideiftwostringsareanagramsornot. // //变位词(anagrams)指的是组成两个单词的字符相同,但位置不同的单词。比如说,abbcd和abcdb就是一对变位词。 // //使用一个固定数组大小记录各个字符出现的次数,同1.1 #include usingnamespacestd; boolisAnagrams(constch
shenlan282
·
2014-04-01 16:00
Cracking
The Coding Interview 1.3
//原文: // //Designanalgorithmandwritecodetoremovetheduplicatecharactersinastringwithoutusinganyadditionalbuffer.NOTE:Oneortwoadditionalvariablesarefine.Anextracopyofthearrayisnot. // //FOLLOWUP // //Wr
shenlan282
·
2014-04-01 16:00
Cracking
The Coding Interview 1.2
//原文: // //WritecodetoreverseaC-StyleString.(C-Stringmeansthat“abcd”isrepresentedasfivecharacters,includingthenullcharacter.) // //从前向后交换,到中间为止 #include usingnamespacestd; voidmSwap(char&a,char&b) {
shenlan282
·
2014-03-31 13:00
Cracking
The Coding Interview 1.1
//原文: // //Implementanalgorithmtodetermineifastringhasalluniquecharacters.Whatifyoucannotuseadditionaldatastructures? // //使用一个数组来记录该字符是否出现过,这里假定只为小写字母。 #include usingnamespacestd; boolisUnique(constc
shenlan282
·
2014-03-31 13:00
Cracking
the coding interview--14.1-14.6
题目14.1原文:Intermsofinheritance,whatistheeffectofkeepingaconstructorprivate?译文:在继承方面,保持一个构造函数私有的作用是什么?解答14.1使构造函数私有可以使类只供内部使用,只被调用一次,生成的实例是单一的,单例模式就是一个很好的例子。classSingleton{ privatestaticSingletoninstan
Mars_NAVY
·
2014-03-20 21:00
Cracking
the coding interview--Q12.7
题目原文:Youhavetodesignadatabasethatcanstoreterabytesofdata.Itshouldsupportefficientrangequeries.Howwouldyoudoit?译文:你必须设计一个能存储TB级数据的数据库,并且它支持高效的区间查询,该怎样设计它?解答首先要明确,并不是所有的字段都可以做区间查询。比如对于一个员工,性别就没有所谓的区间查询;
Mars_NAVY
·
2014-03-19 16:00
上一页
4
5
6
7
8
9
10
11
下一页
按字母分类:
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
其他