原创 Design Pattern--Singleton

Design Pattern 參考 ooDesign Singleton Singletons used for centralized management of internal or external resources (1 )

原创 Implement Stack Using Queue

We are given a Queue data structure that supports standard operations like enqueue() and dequeue(). We need to implemen

原创 文本編譯器(彙編語言實現的)

這是一個文本編輯器的源碼:自己用MASM編譯一下,肯定能用 red_chr macro                              ;讀取字符宏定義         mov ah,0         int 16h endm

原创 Reverse String Question

Reverse String Question 1 Reverse the string word by word (from leetcode) For example, Given s = "the sky is blue", ret

原创 Gridland acm

1015. Gridland Time Limit: 1.0 Seconds   Memory Limit: 65536KTotal Runs: 2943   Accepted Runs: 1158     Background For

原创 關於SQLserver 2000的安裝問題

最近在上數據庫的課程,因爲上機實驗所以要安裝這個軟件,其中遇到了一些問題,也看了網上很多解決方法,總結一下 很多人在安裝時遇到掛起操作提示時,進行不下去了,只能按確定退出安裝。重啓計算機後依然沒用,還是有掛起提示。即使在HKEY_LOCA

原创 hashtable HashMap相關問題

1 Hash Function (1) it always returns a number for an object (2) two equal objects will always have the same number (3

原创 N sum Question

N sum question from leetcode and lintcode 1 two sum (1) Use HashMap to store (nums[i] , index); time O(n) space O(n) o

原创 Partition Array/ Sort Color

Partition array 和leetcode中sort color的想法類似: 用two pointer, 一個start (< k), 一個end( >= k),遇到不滿足的就交換 Partition Array question

原创 Maximum Subarray問題

Subarray 問題關鍵: 利用前綴和 sum[i] = num[0] + num[1] + num[2] + ....... + num[ i ] ; 1 Maximum Subarray / Minimum Subarray  Tw

原创 A data structure for n elements and O(1) operations

GFG上的一道數據結構的題: http://geeksquiz.com/data-structure-n-elements-o1-operations/ 設計一個數據結構插入刪除和查找都是O(1),存儲 0 - n-1 最初想法是hash

原创 Find common elements in three sorted arrays

Geeksforgeeeks上的一道題,原文http://www.geeksforgeeks.org/find-common-elements-three-sorted-arrays/ iven three arrays sorted

原创 Factorial Trailing Zeros

leetcode question Given an integer n, return the number of trailing zeroes in n!.Your solution should be in logarithmic

原创 CC150 OOD question BlackJack

version 5 chapter 8 question 1 https://github.com/gaylemcd/ctci/tree/master/java/Chapter%208/Question8_1 題目是設計紙牌的數據結構,

原创 [phone]找連續字符組成的substring的組成char

其實是個很easy的問題,但是當時的code就是寫的很垃圾,提示再三才寫了這麼一個code,應該還有可以improve的空間。 典型的雙指針問題,一前一後找substring,這裏要考慮如何節省空間,儘可能的少存解。要求 one loop