Re: [問題] 未排序的陣列,演算法相關問題

看板CSSE作者 (LetMeGoogleThatForYou)時間14年前 (2010/06/11 13:18), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串13/13 (看更多)
※ 引述《cai7773 (蓄勢待發)》之銘言: : Algorithm : : Assume m >= n : Sort array X[1:m] and Y[1:n] Time complexity = O( log m ) ↖ ↗ I'd like to smoke what you were smoking... XD : For each i = 1:m, : Find d-X[i] in array Y using bisection method : Time complexity = O( m*log n) : Total Time complexity = O( m * log n) : ※ 引述《mqazz1 (無法顯示)》之銘言: : : given two unsorted arrays X and Y, : : each contains m and n numbers, separately. : : design an algorithm so that, : : given a number d, : : it could determine if there exists two integers i and j, : : such that X[i] + Y[i] = d : : use less than O(m*n) running time : : 我想請問這題大致上從哪方面下手會比較簡易 : : 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 65.87.177.87
文章代碼(AID): #1C4SSOM0 (CSSE)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 13 之 13 篇):
文章代碼(AID): #1C4SSOM0 (CSSE)