自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

hackerzchao

总是有人要赢的,那为什么不能是我呢?

  • 博客(11)
  • 资源 (1)
  • 收藏
  • 关注

原创 快速排序和堆排序

1.快速排序         快速排序是不稳定的排序算法,平均时间复杂度O(nlgn)。快速排序是利用了partition( )进行排序的。partition( )有两种实现形式,(1)利用两个指针一个头指针,一个尾指针,通过交换头尾指针所指的数进行排序; (2)一前一后两个指针同时从左往右进行遍历,如果前指针所遇到的数比主元小,则后指针右移一位,然后交换。Partition方法还可以用在很多地

2014-10-31 22:30:17 846

原创 cracking the coding interview No1.8

1.8Assume 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 is a rotation of s1 using only onw call to is Subst

2014-10-19 17:00:46 673

原创 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;

2014-10-19 16:50:22 560

原创 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?

2014-10-19 16:43:08 550

原创 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 wou

2014-10-19 16:21:30 767

原创 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 space at the end of the string to hold the additional characters,and that you are given the 

2014-10-19 16:08:46 602

原创 cracking the coding interview No1.3

1.3 Given two strings,write a method to decide if one is permutation of the other.

2014-10-19 15:26:11 601

转载 ABC

 很不错的文章,值得好好看看 ->_-> 本文作者@guitardave24 ">David Byttow 是一名程序员,曾在 Google 和 Square 等公司工作过。 在正文之前,先让我们回答几个简单的问题:第一,你面试过多少家公司;第二,这些公司中,录取你的有多少?记下这两个数字,然后代入下面这个算式中(为我自己发明,仅供参考,不具有其他意义): # x = nu

2014-10-19 11:37:28 829

转载 cracking the coding interview 中文版 (程序员面试金典)

 转自:CTCI面试系列——谷歌面试官经典作品 | 快课网 谷歌面试官经典作品(CTCI)目录 1.1 判断一个字符串中的字符是否唯一 1.2 字符串翻转 1.3 去除字符串中重复字符 1.8 利用已知函数判断字符串是否为另一字符串的子串 2.1 从链表中移除重复结点 2.2 实现一个算法从一个单链表中返回倒数第n个元素 2.3 给定链表中间某结点指针,删除链表中该结点 2

2014-10-19 11:32:00 32489 3

原创 cracking the coding interview No1.2

 1.2Implement a function vod reverse(char *str)in C or C++which reverses a null-terminated string.

2014-10-19 11:15:56 965

原创 cracking the coding interview No1.1

 1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?

2014-10-19 10:57:10 852 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除