原创 leetcode:3Sum問題

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in

原创 58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wor

原创 pox控制器學習總結

Pox架構: Pox由內核(core)、組件(component)組成,內核是所有組件的集結地,有了內核,一個組件想使用另一個組件無需通過import,而只需向內核註冊,組件之間可以通過內核來交互。內核主要模塊有:openflow和of

原创 pox事件系統

當pox運行了一個轉發app時,pox是怎麼通過事件系統來運行這個app的,下面我們以l2_learning.py爲例來分析下這個事件系統: l2_learning.py文件定義了兩個類:LearningSwitch、l2_learnin

原创 學習pox心得

pox框架: pox由內核(core)、組件(component)組成,core主要有兩個模塊:of_01、openflow。模塊‘of_01’循環監聽有openflow1.0協議的交換機的連接,pox通過模塊‘openflow’控制所

原创 今日頭條2017校招筆試題

一些出題人出了n道題,每道題有一個難度係數,難度係數滿足以下關係的3道題可以組成一套試卷,爲了使這n道題使用上且只能使用一次,問出題人最少還要出多少題? a<=b<=c b-a<=10; c-b<=10; 之前代碼有點小問題,現在修改

原创 leetcode: 9. Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. 判斷一個整數是不是“迴文”。 思路:將整數反轉,然後判斷兩者是否相等。 附上代碼:

原创 微軟2017校招第一題

解題思路是採用遞歸,跳出條件是:兩兩相加不再是奇數。 附上代碼: #include <iostream> #include <vector> using namespace std; class Solution { public

原创 java8 stream

Java 8 中的 Stream 是對集合(Collection)對象功能的增強,它專注於對集合對象進行各種非常便利、高效的聚合操作(aggregate operation),或者大批量數據操作 (bulk dataoperation)。

原创 最長公共子串 and 最長公共序列

鏈接:https://www.nowcoder.com/questionTerminal/98dc82c094e043ccb7e0570e5342dd1b 來源:牛客網最長公共子串和最長公共子序列。。。

原创 新增函數式接口 java.util.function

函數式接口:只有一個抽象方法的接口 JDK8之前已有的函數式接口有:Runnable、Callable、 Comparator、 InvocationHandler、 PathMatcher 。。。等等 新定義的函數式接口:java.ut

原创 劍指Offer : BST轉爲雙向鏈表

輸入一棵二叉搜索樹,將該二叉搜索樹轉換成一個排序的雙向鏈表。要求不能創建任何新的結點,只能調整樹中結點指針的指向。 利用left作爲雙向鏈表的前驅指針,right作爲雙向鏈表的後驅指針,採用遞歸從子樹開始轉換。 package con

原创 Search in Rotated Sorted Array

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 m

原创 Convert Sorted List to Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 思路:找到中間節點

原创 43. Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be