摘要:
new & delete expression1. IntroductionA new expression allocates and constructs an object of a specified type.A new[] expression allocates and constru... 阅读全文
摘要:
1. Convert Expression to Reverse Polish Notation http://www.lintcode.com/en/problem/convert-expression-to-polish-notation/ Given an expression string array, return the Polish notation of this e... 阅读全文
摘要:
1 Same Tree https://leetcode.com/problems/same-tree/ Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurall... 阅读全文
摘要:
What is it? TIME-WAIT状态的主要作用在于TCP连接的拆除阶段。拆除一个TCP连接通常需要交换4个segment,如下图所示: Host1上的应用程序关闭了自己这一端的连接,使得TCP向Host 2发送了一个FIN。Host 2对这个FIN进行ACK,并将这个FIN作为一个EOF传送给应用程序(假设Host 2上的应用程序有一个挂起的read操作)。经过一段时间后,Hos... 阅读全文
摘要:
BST 以下BST的定义来自于Wikipedia: Binary Search Tree, is a node-based binary tree data structure which has the following properties: The left subtree of a node contains only nodes with keys less ... 阅读全文
摘要:
1. Palindrome Partitioning https://leetcode.com/problems/palindrome-partitioning/ Given a string s, partition s such that every substring of the partition is a palindrome. Return all possibl... 阅读全文
摘要:
基础知识 二分非递归写法: int binary_search(const int a[], const int size, const int val) { int lower = 0; int upper = size-1; /* invariant: if a[i]==val for any i, then lower >1; if (val ==... 阅读全文
摘要:
给定一个等概率随机产生1~M的随机函数rand1ToM如下: public int rand1ToM(int m) { return (int) (Math.random() * m) + 1; } 除此之外不能使用任何额外的随机机制。有两个输入参数分别为m和n,请用rand1ToM(m)实现等概率随机产生1~n的随机函数rand1ToN。 Solution 在做这道题之前,我们先... 阅读全文
摘要:
https://leetcode.com/problems/kth-largest-element-in-an-array/ Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinc... 阅读全文
摘要:
1. Introduction We now turn to the process control provided by the UNIX System. This includes the creation of new processes, program execution, and process termination. We also look at the various... 阅读全文
摘要:
1 Introduction 所谓的InternetWorking就是将很多网络连接起来,那么在这种连接的网络下我们该如何传送封包呢? 2 IP and Routers 1 IP Datagram Header Format IP Address:目前IP地址均是32个bit,称为IPV4。未来会使用IPV6,128个bit。 Identification:Router本身将封包收下... 阅读全文
摘要:
http://www.lintcode.com/en/problem/longest-increasing-continuous-subsequence-ii/# Give you an integer matrix (with row size n, column size m),find the longest increasing continuous subsequence i... 阅读全文