[C++]Item18. Make interfaces easy to use correctly and hard
接口容易被正確使用,不易被誤用 c++簡單工廠模式時,初級實現為ITest* CreateTestOld(), 然後用戶負責釋放返回的對象。
Cracking the coding interview: 查找文中兩個單詞的距離
題目:You have a large text file containing words. Given any two words, find the
C++ - 虛繼承(virtual inheritance)的構造(construct)和析構(destruct)順序
虛繼承(virtual inheritance)的構造(construct)和析構(destruct)順序 在多重繼承的時候, 構造順序是 虛繼承按順
UVA 10755 - Garbage Heap(三維子矩陣最大和)
Garbage Heap Time limit: ? seconds Memory limit: 64 megabytes Farmer John h
LeetCode之Trapping Rain Water
【題目】 Given n non-negative integers representing an elevation map where the
cf 61E. Enemy is weak 樹狀數組求逆序數
求出每個位置左邊有幾個比它大,右邊有幾個比它小,然後乘法原理加起來就夠了。 大於小於什麼的用樹狀數組YY一下就出來了。 #include #include
UVA 10535 - Shooter(掃描+幾何+最大重疊區間)
Problem E Shooter Input: Standard Input Output: Standard Output Time Limit:
opaque struct——c/c++如何隱藏內部結構體的定義?
學習過VLC的童鞋都會看得類似這樣的代碼: /** This structure is opaque. It represents a li