Programming Reflection (Jun 8, 2017)

wpid-Programming-Wallpaper-3

1.  BITT Principle

Brute Force (暴力解法,低效/费空间)
Improvement (优化解法,高效/省空间)
Time and space complexity (时间/空间复杂度)
Test (测试)

2. Array is sorted and may have better performance (3Sum o(n^2) solution)

数组排序过后可能有奇效

3. Test cases are designed on purpose to test the functionality, not randomly selected.

In the example of 3sum problem,

test cases could be:

0, 1, 2 elements for input array to test shorter array than the requirement

[1, 0, 1] for no matched triplets

[-1, -1, -1, 2, 2, 2, 2] for many duplicate triplets

测试用例是用来测试具体功能的,并非任意设计。

 

Donate $5 to me for a coffee with PayPal and read more professional and interesting technical blog articles. Feel free to visit my web app, WhizWallet, to apply for credit, store or gift cards, DealsPlus to browse daily deals and store coupons to save money.
Follow me @Yaoli0615 at Twitter to get latest tech updates.
Resources:

Ruminations on C++: A Decade of Programming Insight and Experience

Advertisements

About liyao13

Yao Li is a web and iOS developer, blogger and he has a passion for technology and business. In his blogs, he shares code snippets, tutorials, resources and notes to help people develop their skills. Donate $5 to him for a coffee with PayPal at About Me page and read more professional and interesting technical blog articles. Follow him @Yaoli0615 at Twitter to get latest tech updates.
This entry was posted in CS Research&Application, Intern&Job, Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s