令人頭痛的演算法題
Given an array of integers stored in a file with one number per line,
find all the pairs of integers that add up to 8. The output will also needs
to be stored in a file with one pair per line.
>
> An example input array looks like this:
> 3
> 2
> 4
> 6
> 5
> 7
> 20
> 1
>
> The output will be like this:
> 3 5
> 2 6
> 7 1
>
>You need to do the following.
>
>a) Write a simple design document to outline your approach.
>
>b) Write a java program to implement your design with proper comments.
Please note that the input array of integers might be very large. For
example, what about 10 million numbers? Also, what about there are some
negative numbers?
>
>c) Write some junit test cases so that someone else could test your
program.
find all the pairs of integers that add up to 8. The output will also needs
to be stored in a file with one pair per line.
>
> An example input array looks like this:
> 3
> 2
> 4
> 6
> 5
> 7
> 20
> 1
>
> The output will be like this:
> 3 5
> 2 6
> 7 1
>
>You need to do the following.
>
>a) Write a simple design document to outline your approach.
>
>b) Write a java program to implement your design with proper comments.
Please note that the input array of integers might be very large. For
example, what about 10 million numbers? Also, what about there are some
negative numbers?
>
>c) Write some junit test cases so that someone else could test your
program.
相關文章
- 又是令人頭痛的字元亂碼問題!!請幫忙!字元
- 最令人頭疼的Python問題Python
- 頭痛的ASCII和preg_replace()ASCII
- 教程中 令人頭疼的 前端流安裝前端
- 最令人頭疼的Python問題:Python多執行緒在爬蟲中的應用Python執行緒爬蟲
- 7.消除頭痛十要素[[摘自網路]
- 遊戲研發令人頭禿?借鑑廣告素材試試遊戲
- 影片加密中令人頭疼的錄屏行為怎麼防範?加密
- Excel VBA中寫SQL,這些問題你一定為此頭痛過ExcelSQL
- 在hibernate中複雜的檢索策略讓我頭痛,
- 分散式 | 令人頭疼的堆外記憶體洩露怎麼排查?分散式記憶體洩露
- 為什麼演算法的公平性令人難以捉摸?演算法
- 程式設計師歌曲《程式設計師偏頭痛》程式設計師
- 痛!痛!痛!我們的好兄弟Git,一路走好!Git
- 資訊不匹配痛點與頭位資訊解決之策
- 車路協同若干痛點問題的思考
- 【演算法】演算法菜鳥的爛筆頭演算法
- [演算法] 演算法菜鳥的爛筆頭演算法
- 令人投入的玩法因素
- 6個問題解決產品銷量的痛點
- 前端學習演算法3:一道來自頭條的面試題前端演算法面試題
- Java的痛腳Java
- 如何解決冷凍電鏡(cryo-EM)中最頭痛的取向優勢?
- 令人期待的 PHP7.4PHP
- ? 令人愉快的 JavaScript 測試JavaScript
- 關於痛經問題, 送給 IT 女同胞的關懷。
- 國產化浪潮下TiDB解決的痛點問題TiDB
- PHP檔案頭BOM頭問題PHP
- WkWebView 令人崩潰的崩潰WebView
- 後期資料庫主從架構的痛點,真的痛資料庫架構
- 令人頭大: Mac提示應用程式無法開啟,檔案損壞怎麼辦?Mac
- 真的炸了:讓人頭痛的小程式之『圖片懶載入』終極解決方案
- 頭條的演算法推薦,並不神祕!演算法
- DES演算法,標頭檔案 (轉)演算法
- 看標頭檔案猜演算法演算法
- Object.assign()的痛點Object
- webgl濾鏡--會呼吸的痛Web
- 實施DevOps的痛點dev