小小程序媛  
得之坦然,失之淡然,顺其自然,争其必然

2016年2月25日

摘要: 1. 若一组待排数据有序,花费时间最多的是:快速排序,T(n)=O(n^2); 2. 有 1000 个无序的整数,希望使用最快的方式找出前 50 个最大的,最佳的选择是? 快速排序:在最理想的情况下,即划分可以使得每次分到n/2 的两个序列,复杂度为o(nlogn); 堆排序:无论什么情况都是o(n 阅读全文
posted @ 2016-02-25 15:05 Coding菌 阅读(276) 评论(0) 推荐(0) 编辑
 
摘要: 序 求最大公约数的最常用的算法是欧几里得算法,也称为辗转相除法。问题定义为求i和j的最大公约数gcd(i,j),其中i和j是整数,不妨设i>j。算法可以递归的表示:1. 如果j能整除i,那么gcd(i,j)=j; 2. j不能整除i,令r=i%j,那么gcd(i,j)=gcd(j,r)。 C实现 i 阅读全文
posted @ 2016-02-25 14:49 Coding菌 阅读(1756) 评论(0) 推荐(0) 编辑

2016年2月24日

摘要: 1. 在C++中,不能被重载的运算符有: sizeof . 成员运算符 .* 成员指针运算符 :: 作用域运算符 ?: 条件运算符 2. C++语言多态性:编译时多态和运行时多态: 编译时多态可通过函数重载和模板实现; 运行时多态可通过虚函数实现; 实现运行时多态机制称为动态绑定; 3. C++中, 阅读全文
posted @ 2016-02-24 20:24 Coding菌 阅读(968) 评论(0) 推荐(0) 编辑

2016年1月4日

摘要: 类对象的构造 再次阅读与总结C++程序设计语言,依然能够引发深刻的思考与再思考~~~ ======================================================================================= 考虑建立对象(特别是类对象)的各种不同 阅读全文
posted @ 2016-01-04 20:26 Coding菌 阅读(295) 评论(0) 推荐(0) 编辑

2015年12月28日

摘要: 题目 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exa 阅读全文
posted @ 2015-12-28 13:42 Coding菌 阅读(327) 评论(0) 推荐(0) 编辑
 
摘要: 1. UDP概述 UDP 是User Datagram Protocol的简称, 中文名是用户数据报协议,是OSI(Open System Interconnection,开放式系统互联) 参考模型中一种无连接的传输层协议,提供面向事务的简单不可靠信息传送服务,IETF RFC 768是UDP的正式 阅读全文
posted @ 2015-12-28 11:41 Coding菌 阅读(2170) 评论(0) 推荐(0) 编辑

2015年12月27日

摘要: 题目 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in 阅读全文
posted @ 2015-12-27 16:20 Coding菌 阅读(189) 评论(0) 推荐(0) 编辑

2015年12月26日

摘要: 题目 Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed fro 阅读全文
posted @ 2015-12-26 14:36 Coding菌 阅读(235) 评论(0) 推荐(0) 编辑
 
摘要: 题目 Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac 阅读全文
posted @ 2015-12-26 13:57 Coding菌 阅读(402) 评论(0) 推荐(0) 编辑

2015年12月23日

摘要: 1. 线程 传统Unix模型中,当一个进程需要另一个实体来完成某事,它就fork一个子进程来处理。Unix上大多数网络服务器程序便是以创建多个子进程的方式实现的:父进程accept一个连接,fork一个子进程,该子进程处理与该连接对端的客户之间的通信。 尽管,这种范式多年来一直用的不错,但是fork 阅读全文
posted @ 2015-12-23 19:43 Coding菌 阅读(384) 评论(0) 推荐(0) 编辑