given a 1D array.The task is to convert it in to a 2D array and values
should be filled spirally while filling from 1D array
the size of 1D array is multiple of a constant say n.
the number of rows and columns of 2D array will be given.
say number of rows =R
say number of columns = C
k*n =
In an array, some numbers occur only once, some numbers occur twice, only
one number occur thrice. Find the number occuring thrice ? Space complexity
O(1) Time Complexity O(n). We should not use Hash Maps.
Please someone help..
--
You received this message because you are subscribed to the
int main() {
int a[] = {1,2,2,3,3,3,4,4};
int size = sizeof(a)/sizeof(a[0]);
int xorr=0;
for(int i=0;isize;i++) {
xorr^=a[i];
}
int x=0,y=0;
int xor1=xorr ~(xorr-1);
for(int i=0;isize;i++) {
if(xor1 a[i]) x^=a[i];
else y^=a[i];
}
cout xy;
}
in this 1 and 3 would be output. as it
search the previous posts before posting
search for
[algogeeks] Amazon Interview Question
you will get this
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I have a practical problem, need an optimal solution for this
*What is given?*
Given *N* sets, each containing some jobs to be executed, such that no two
sets are subsets of each other and number of jobs in *i-th* set is *ni N*
.
The jobs can have values between *1...k where k N*. Priority of
correcting my last statement
So basically the problem needs to be optimized on two aspects, minimizing
costs and maximizing the total weight of executed jobs.
so *Maximize ( 1 + (Total Weight of executed jobs in j-th iter/ Total Cost
incurred in j-th iter) )*
On Sat, Apr 20, 2013 at 3:49 AM,
As my understanding take the input of traffic in time interval then some
all the job and divide them equally to processing unit(assumption
processing unit processing one job in one time units) so interval to time
is varies on the base how much time is taken by the process to assigned
work. One
Hi Nishant i did not understand the code can u please describe a bit
Thanks
On Fri, Apr 19, 2013 at 10:48 AM, rahul sharma rahul23111...@gmail.comwrote:
search the previous posts before posting
search for
[algogeeks] Amazon Interview Question
you will get this
--
You received this