標籤:海量資料面試題整理 1. 給定a、b兩個檔案,各存放50億個url,每個url各佔64位元組,記憶體限制是4G,讓你找出a、b檔案共同的url? 方案1:可以估計每個檔案安的大小為50G×64=320G,遠遠大於記憶體限制的4G。所以不可能將其完全載入到記憶體中處理。考慮採取分而治之的方法。 s 遍曆檔案a,對每個url求取,然後根據所取得的值將url分別儲存到1000個小檔案(記為)中。這樣每個小檔案的大約為300M。 s
Largest Number,largestnumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be very large, so you
Search a 2D Matrix,search2dmatrixWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row is greater than the
leetcode_6_ZigZag Conversion,leetcode_6_zigzag描述:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A
(hdu step 1.3.3)Tian Ji,hdu1.3.3題目: Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4411 Accepted Submission(s): 1069 Problem
[LeetCode]168.Excel Sheet Column Title,leetcode168.excel【題目】Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28
(HDUStep 1.2.6)decimal system(任意進位轉十進位),hdustep1.2.6題目: decimal systemTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3622 Accepted Submission(s): 1419 Problem DescriptionAs we know , we