wu :: forums
« wu :: forums - Largest values from cartesian product of arrays. »

Welcome, Guest. Please Login or Register.
Nov 24th, 2024, 5:54am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: Eigenray, Icarus, towr, SMQ, william wu, ThudnBlunder, Grimbal)
   Largest values from cartesian product of arrays.
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Largest values from cartesian product of arrays.  (Read 1488 times)
witee
Newbie
*





   
Email

Posts: 48
Largest values from cartesian product of arrays.  
« on: Aug 8th, 2010, 6:51am »
Quote Quote Modify Modify

Given two sorted positive integer arrays A(n) and B(n), we define a set S = {(a,b) | a A and b B}. Obviously there are n2 elements in S. The value of such a pair is defined as Val(a,b) = a + b. Now we want to get the n pairs from S with largest values.
T.C <=(nlogn)
 
 
 
//title changed --towr
« Last Edit: Aug 8th, 2010, 8:15am by towr » IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Array  
« Reply #1 on: Aug 8th, 2010, 8:13am »
Quote Quote Modify Modify

It might be nice if you tried to use somewhat more descriptive titles, we don't need a dozen threads called "array"; the whole point of having titles on a thread is so people can tell them apart and can at a glance get some idea of what they are about.  
Also if you don't make up the problems yourself, you could try searching if they aren't already on the site... several times... using practically the same wording...
 
http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_cs; action=display;num=1204984748
http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi?board=riddles_cs; action=display;num=1132204952
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board