2013年10月24日

Searching a 2D Sorted Matrix Part I

摘要: Write an efficient algorithm that searches for a value in annxmtable (two-dimensional array). This table is sorted along the rows and columns — that is,Table[i][j] ≤ Table[i][j + 1],Table[i][j] ≤ Table[i + 1][j]Solution:1. STEP 方法:Start in the bottom-left corner of your matrix. Then go to the right 阅读全文

posted @ 2013-10-24 13:16 Step-BY-Step 阅读(321) 评论(0) 推荐(0) 编辑

Integer to Roman

摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字共有7个,即I(1)、V(5)、X(10)、L(50)、C(100)、D(500... 阅读全文

posted @ 2013-10-24 02:14 Step-BY-Step 阅读(368) 评论(0) 推荐(0) 编辑

导航