令人頭痛的演算法題
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多執行緒在爬蟲中的應用Python執行緒爬蟲
- 影片加密中令人頭疼的錄屏行為怎麼防範?加密
- Excel VBA中寫SQL,這些問題你一定為此頭痛過ExcelSQL
- 為什麼演算法的公平性令人難以捉摸?演算法
- 分散式 | 令人頭疼的堆外記憶體洩露怎麼排查?分散式記憶體洩露
- 令人迷惑的GammaGAM
- 考研複試中,有哪些令人窒息的問題?
- 痛!痛!痛!我們的好兄弟Git,一路走好!Git
- 遊戲研發令人頭禿?借鑑廣告素材試試遊戲
- 車路協同若干痛點問題的思考
- [演算法] 演算法菜鳥的爛筆頭演算法
- 【演算法】演算法菜鳥的爛筆頭演算法
- 令人投入的玩法因素
- 如何解決冷凍電鏡(cryo-EM)中最頭痛的取向優勢?
- 以色列海法大學:研究證明牽手能緩解頭痛
- 前端學習演算法3:一道來自頭條的面試題前端演算法面試題
- ? 令人愉快的 JavaScript 測試JavaScript
- 令人困惑的 TensorFlow!(II)
- 令人期待的 PHP7.4PHP
- 6個問題解決產品銷量的痛點
- 國產化浪潮下TiDB解決的痛點問題TiDB
- 關於痛經問題, 送給 IT 女同胞的關懷。
- 資訊不匹配痛點與頭位資訊解決之策
- 為公益狂走4000億步,消消樂發起的步數挑戰為何如此令人上頭?
- 後期資料庫主從架構的痛點,真的痛資料庫架構
- 令人頭大: Mac提示應用程式無法開啟,檔案損壞怎麼辦?Mac
- 2150: 令人討厭的手機號
- 《天神鎮》是如何令人神往的
- Object.assign()的痛點Object
- 頭條的演算法推薦,並不神祕!演算法
- 看標頭檔案猜演算法演算法
- 軟體工程令人不安的真相 • Buttondown軟體工程
- 如何制定出令人讚歎的決策?
- webgl濾鏡--會呼吸的痛Web
- 淺析Web components的痛點Web
- 數字化轉型Top5 痛點問題剖析
- 令人拍案叫絕的 Wasserstein GAN,徹底解決GAN訓練不穩定問題
- 柔性振動盤——解決顧客產品的上料痛點難題