原创 leetcode 虐我篇之(二) Two Sum

正所謂有了第一次被虐,就會有第二次。今天,實驗室只有我一個人,因爲是暑假,大家不是去實習就是回家之類的。剩下我一個人在做導師和一個公司合作的項目。今天週六所以給自己放個假(前幾周都是沒有周六日,天天去公司幹,要死的節奏啊)。看了《爸爸去哪

原创 leetcode 虐我篇之(五)Remove Duplicates from Sorted Array

    昨天晚上被Remove Duplicates from Sorted List 虐慘了。因爲鏈表東西不熟悉。今天我就找了一題類似的,但是這次操作的是數組。題目是Remove Duplicates from Sorted Arra

原创 leetcode 虐我篇之(三)Remove Duplicates from Sorted List

今天我又來受虐了。今天做的題目是Remove Duplicates from Sorted List。題目描述如下: Given a sorted linked list, delete all duplicates such tha

原创 leetcode 虐我篇之(四)Remove Duplicates from Sorted List II

前面做了Remove Duplicates from Sorted List  今天就順便把Remove Duplicates from Sorted List  II 也做一下。前面的第一個去重的可以參考我的前一篇文章。 題目的描述如下

原创 leetcode 虐我篇之(一)Reverse Words in a String

第一次寫CSDN博客,有點小緊張和激動。對於一些文章編排、字體、佈局、貼代碼等不是很熟悉,希望不要被噴的不行。寫這個也是爲了讓自己以後能翻看一下,看看自己的思路解法有沒有得到進步。另外,也可以給大家提些意見,希望不要被罵得不行。 自己對於

原创 libevent安裝與libevent定時器

主要是參考了一下網上的方法,http://blog.sina.com.cn/s/blog_4b93170a0100mbm9.html 並自己實際操作了一下,針對自己出現的一些情況進行說明。並在實際編譯鏈接過程中進行實踐。 這些其實都是

原创 leetcode 虐我篇之(二十一)Climbing Stairs

        剛剛做了一道很簡單的題目,這次這道題目好像也是比較簡單啊Climbing Stairs,題目描述如下: You are climbing a stair case. It takes n steps to reach t

原创 JVM垃圾回收(GC)原理

轉自:http://chenchendefeng.iteye.com/blog/455883   一、相關概念 基本回收算法 1. 引用計數(Reference Counting)  比較古老的回收算法。原理是此對象有一個引用,即增加一個

原创 leetcode 虐我篇之(十七)Binary Tree Level Order Traversal

        二叉樹的前中後序遍歷都做完了,現在就到層級遍歷了Binary Tree Level Order Traversal,題目描述如下: Given a binary tree, return the level order t

原创 leetcode 虐我篇之(十六)Binary Tree Postorder Traversal

        既然前面做完了二叉樹的非遞歸前序、中序遍歷,自然地就輪到這題了Binary Tree Postorder Traversal,題目描述如下: Given a binary tree, return the postorde

原创 leetcode 虐我篇之(十五)Binary Tree Inorder Traversal

        剛剛做完了二叉樹的非遞歸先序遍歷,現在來做做中序遍歷Binary Tree Inorder Traversal,題目描述如下: Given a binary tree, return the inorder traver

原创 前後重組字符串

        距離上次寫博客已經快一個月了,最近這個月都一直在忙着找工作,現在暫時有了一個offer,剛好昨天去網易筆試了一下,就將裏面的題目拿出來做做。         題目是這樣子的:輸入一個字符串src,從這個字符串去除頭或者尾一

原创 leetcode 虐我篇之(九)Roman to Integer

   今晚前面連做了兩道簡單題目後,現在接着做這道AC率高的題目,Roman to Integer,題目描述如下: Given a roman numeral, convert it to an integer. Input is gu

原创 UNIX網絡編程 學習1

這篇文章主要是針對《UNIX網絡編程》裏面的代碼進行學習,第一個程序是回射服務器的服務器端和客戶端的代碼。 下面講解一下如何運行這第一個程序。 學習unix網絡編程,源代碼下載:www.unpbook.com 中下載。 解壓後,打

原创 leetcode 虐我篇之(二十)Search Insert Position

        Search Insert Position  題目描述如下: <span style="font-size:12px;">Given a sorted array and a target value, retur