07 2015 档案
摘要:本文内容主要从http://blog.csdn.net/column/details/killthreadseries.html转载而来,作为学习并整理自己的一些想法。一.概念性问答题线程的基本概念、线程的基本状态及状态之间的关系?线程是进程中的一个实体,是被系统独立调度和执行的基本单位。线程,有时...
阅读全文
摘要:5.希尔排序(Shell)void shellsort1(int num[], const int len){ if (len 0; dlen /= 2) //确定步长 { for (i = 0; i = 0 && num[k] > temp) ...
阅读全文
摘要:1.冒泡排序void bubblesort(int num[],const int len){ if (len i; j--) { if (num[j] num[i + 1]) { temp = num[...
阅读全文
摘要:1.求字符串中连续出现最多的字串pair substring(const string& str){ int i, j, k, len = str.length(), count, maxcount = 1; string substr; vector substrs; //...
阅读全文
摘要:因为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...
阅读全文
摘要:void * memcpy(void * dst, const void * src, size_t count){ void *res=dst; while (count--) { *(char*)dst = *(char*)src; dst = (...
阅读全文
摘要:const char* strstr(const char *str, const char* substr){ int i, j, temp; for (i = 0; str[i] != '\0'; i++) { j = 0; temp = i; //...
阅读全文
摘要:1.TCP/IP协议的体系结构包含四层:应用层(负责应用程序的网络服务,通过端口号识别各个不同的进程)-》传输层(传输控制层协议TCP、用户数据报协议UDP、互联网控制消息协议ICMP)-》网络层-》网络接口层(负责将二进制流转换成数据帧,并进行数据帧的发送和接收)-》硬件层。2.服务器是指能在网络...
阅读全文
摘要: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...
阅读全文
摘要: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 -> ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要:Given an integer, write a function to determine if it is a power of two.//初始理解为把数字拆分为两个整数的乘积。。。英语差真操蛋C++:class Solution {public: bool isPowerOfTwo(...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:题目: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...
阅读全文

浙公网安备 33010602011771号