摘要: 有一个只由0,1,2三种元素构成的整数数组,请使用交换、原地排序而不是使用计数进行排序。 给定一个只含0,1,2的整数数组A及它的大小,请返回排序后的数组。保证数组大小小于等于500。 阅读全文
posted @ 2016-08-23 12:33 zhongzhiqiangZz 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 有两个从小到大排序以后的数组A和B,其中A的末端有足够的缓冲空容纳B。请编写一个方法,将B合并入A并排序。 给定两个有序int数组A和B,A中的缓冲空用0填充,同时给定A和B的真实大小int n和int m,请返回合并后的数组。 class Merge { public: int* mergeAB( 阅读全文
posted @ 2016-08-23 11:55 zhongzhiqiangZz 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 请设计一个高效算法,判断数组中是否有重复值。必须保证额外空间复杂度为O(1)。 给定一个int数组A及它的大小n,请返回它是否有重复值。 阅读全文
posted @ 2016-08-23 09:53 zhongzhiqiangZz 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1. TCP Protocol https://codejuan.gitbooks.io/java_interview/content/network-communication/tcp-udp/tcp-handshake.html 2. Network Layer Five-layer Inter 阅读全文
posted @ 2016-08-21 21:42 zhongzhiqiangZz 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-08-21 13:50 zhongzhiqiangZz 阅读(145) 评论(0) 推荐(0) 编辑
摘要: const在前,内容不能变; const在后,指针不能变; const* ,指针指向为常量; *const ,指针本身为常量。 To be continued const在前,内容不能变; const在后,指针不能变; const* ,指针指向为常量; *const ,指针本身为常量。 To be 阅读全文
posted @ 2016-08-21 13:26 zhongzhiqiangZz 阅读(113) 评论(0) 推荐(0) 编辑
摘要: To be continued 阅读全文
posted @ 2016-08-21 11:04 zhongzhiqiangZz 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Primitive Built-in Types: C++ offer the programmer a rich assortment of built-in as well as user defined data types. Following table lists down seven 阅读全文
posted @ 2016-08-21 10:50 zhongzhiqiangZz 阅读(221) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; class ScaleSort { public: vector sortElement(vector A, int n, int k) { if(n == 1){ return A; } int tmp[k]; fo... 阅读全文
posted @ 2016-08-20 23:01 zhongzhiqiangZz 阅读(178) 评论(0) 推荐(0) 编辑
摘要: class Rotation { public: bool chkRotation(string A, int lena, string B, int lenb) { if(lena != lenb) return false; string str_target = A + A; if(KMP... 阅读全文
posted @ 2016-08-20 19:40 zhongzhiqiangZz 阅读(268) 评论(0) 推荐(0) 编辑