摘要: 1.密钥登录原理 一般我们使用xshell访问远程主机(Linux主机)时,都是先请管理员给我们开一个账户,即为我们设置一个一个用户名和对应的密码,然后我们就可以使用下面的方式登录到远程主机了: 在这种情况下,我们使用的是上面密码登录,也就是说只要知道你这个账号及密码的人都可以在任何地方登录到远程主 阅读全文
posted @ 2017-09-17 10:42 ElephantKing 阅读(1518) 评论(0) 推荐(0) 编辑
摘要: 专业解决:int转化为字符串、float转化为字符串及其反向转化正向:#includestringsteam stream;//新建一个流,它只是一个流,没有类型string result;float i=12.3;//或换成int i;stream>result;//将流送入resultcouts... 阅读全文
posted @ 2015-01-30 13:42 ElephantKing 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:根据递增序列,求平衡二叉查找树,根据平衡二叉查找树的性质,其左右都是二叉查找树,用递归可以比较轻... 阅读全文
posted @ 2014-12-29 21:59 ElephantKing 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文
posted @ 2014-12-29 21:45 ElephantKing 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2014-12-14 22:55 ElephantKing 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
posted @ 2014-12-13 15:16 ElephantKing 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:找到链表的中点,作为根,前端作为左子树,后端作为右子树,并对前后做递归操... 阅读全文
posted @ 2014-12-13 12:49 ElephantKing 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?首先指... 阅读全文
posted @ 2014-12-12 00:57 ElephantKing 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题思路:突发奇想,脑洞大开。回路,自然是走到已经走过的地方,如何知道这个地方已经走... 阅读全文
posted @ 2014-12-11 23:16 ElephantKing 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2014-12-10 12:23 ElephantKing 阅读(75) 评论(0) 推荐(0) 编辑