07 2015 档案

摘要:本文内容主要从http://blog.csdn.net/column/details/killthreadseries.html转载而来,作为学习并整理自己的一些想法。一.概念性问答题线程的基本概念、线程的基本状态及状态之间的关系?线程是进程中的一个实体,是被系统独立调度和执行的基本单位。线程,有时... 阅读全文
posted @ 2015-07-27 15:15 从此寂静无声 阅读(247) 评论(0) 推荐(0)
摘要:5.希尔排序(Shell)void shellsort1(int num[], const int len){ if (len 0; dlen /= 2) //确定步长 { for (i = 0; i = 0 && num[k] > temp) ... 阅读全文
posted @ 2015-07-27 09:58 从此寂静无声 阅读(171) 评论(0) 推荐(0)
摘要:1.冒泡排序void bubblesort(int num[],const int len){ if (len i; j--) { if (num[j] num[i + 1]) { temp = num[... 阅读全文
posted @ 2015-07-26 17:21 从此寂静无声 阅读(185) 评论(0) 推荐(0)
摘要:1.求字符串中连续出现最多的字串pair substring(const string& str){ int i, j, k, len = str.length(), count, maxcount = 1; string substr; vector substrs; //... 阅读全文
posted @ 2015-07-25 18:19 从此寂静无声 阅读(169) 评论(0) 推荐(0)
摘要:因为64位下INT_MAX其长度不超过20,故此处将字符串数组传递进函数。int num2str(int num,char str[]){ char c; int i=0, j=0, k=0, tmp = num > 0 ? num : -1 * num; if (num > IN... 阅读全文
posted @ 2015-07-24 23:18 从此寂静无声 阅读(802) 评论(0) 推荐(0)
摘要:void * memcpy(void * dst, const void * src, size_t count){ void *res=dst; while (count--) { *(char*)dst = *(char*)src; dst = (... 阅读全文
posted @ 2015-07-21 11:06 从此寂静无声 阅读(256) 评论(0) 推荐(0)
摘要:const char* strstr(const char *str, const char* substr){ int i, j, temp; for (i = 0; str[i] != '\0'; i++) { j = 0; temp = i; //... 阅读全文
posted @ 2015-07-19 19:45 从此寂静无声 阅读(245) 评论(0) 推荐(0)
摘要:1.TCP/IP协议的体系结构包含四层:应用层(负责应用程序的网络服务,通过端口号识别各个不同的进程)-》传输层(传输控制层协议TCP、用户数据报协议UDP、互联网控制消息协议ICMP)-》网络层-》网络接口层(负责将二进制流转换成数据帧,并进行数据帧的发送和接收)-》硬件层。2.服务器是指能在网络... 阅读全文
posted @ 2015-07-19 19:31 从此寂静无声 阅读(179) 评论(0) 推荐(0)
摘要:Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6... 阅读全文
posted @ 2015-07-15 20:17 从此寂静无声 阅读(203) 评论(0) 推荐(0)
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is1 -> 2 -> 3 -> ... 阅读全文
posted @ 2015-07-15 19:01 从此寂静无声 阅读(119) 评论(0) 推荐(0)
摘要:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.【罗马数字】1~9: {"I", "II", "III", "IV", "V", "VI... 阅读全文
posted @ 2015-07-12 23:19 从此寂静无声 阅读(150) 评论(0) 推荐(0)
摘要:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2015-07-12 22:02 从此寂静无声 阅读(181) 评论(0) 推荐(0)
摘要:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-07-12 17:15 从此寂静无声 阅读(148) 评论(0) 推荐(0)
摘要:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].class Sol... 阅读全文
posted @ 2015-07-12 14:41 从此寂静无声 阅读(144) 评论(0) 推荐(0)
摘要:Given an integer, write a function to determine if it is a power of two.//初始理解为把数字拆分为两个整数的乘积。。。英语差真操蛋C++:class Solution {public: bool isPowerOfTwo(... 阅读全文
posted @ 2015-07-12 13:54 从此寂静无声 阅读(177) 评论(0) 推荐(0)
摘要:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa... 阅读全文
posted @ 2015-07-11 19:25 从此寂静无声 阅读(186) 评论(0) 推荐(0)
摘要:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ask... 阅读全文
posted @ 2015-07-11 18:17 从此寂静无声 阅读(152) 评论(0) 推荐(0)
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet... 阅读全文
posted @ 2015-07-11 16:34 从此寂静无声 阅读(138) 评论(0) 推荐(0)