2018年3月8日

ovs-ofctl:version negotiation failed (we support version 0x01, peer supports version 0x04)

摘要: 查看Open vSwitch中的流表时出错。 sudo ovs-vsctl dump-flows s1 2018-03-08T06:23:42Z|00001|vconn|WARN|unix:/var/run/openvswitch/s1.mgmt: version negotiation faile 阅读全文

posted @ 2018-03-08 14:44 IT_Amateur 阅读(1652) 评论(0) 推荐(0) 编辑

2018年2月7日

[LeetCode]-146.LRU Cache

摘要: 题目: 为最近最少使用(LRU)缓存设计并实现了一个数据结构。它应该支持以下操作:查询和插入,并且时间复杂度为O(1)。 查询(key)-如果键存在于缓存中,则获得键值(总是正数),否则返回- 1。插入(key,value)-如果键不存在,则插入(键,值);如果键存在,则设置键所对应的值。当缓存达到 阅读全文

posted @ 2018-02-07 17:04 IT_Amateur 阅读(135) 评论(0) 推荐(0) 编辑

2018年2月6日

二叉树的非递归遍历-O(1)空间

摘要: 问题描述: 对一颗二叉树进行中序遍历,要求空间复杂度为O(1),即常数空间。 解题方法: 由于要求空间复杂度为O(1),显然不能采用递归和栈的方式来遍历。由于树中的叶子节点的左右指针域都为空, 因此可以利用叶子节点的指针域记录后驱节点,类似于线索二叉树,这种方法叫Morris Traversal方法 阅读全文

posted @ 2018-02-06 11:28 IT_Amateur 阅读(237) 评论(0) 推荐(0) 编辑

LeetCode 89. Gray Code

摘要: 题目: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total 阅读全文

posted @ 2018-02-06 09:05 IT_Amateur 阅读(197) 评论(0) 推荐(0) 编辑

2018年2月5日

97. Interleaving String

摘要: 题目: 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 @ 2018-02-05 09:57 IT_Amateur 阅读(129) 评论(0) 推荐(0) 编辑

导航