I actually attended on-campus through my college...
On 26 May 2011 16:24, jagannath prasad das jpdasi...@gmail.com wrote:
how to register for amazon ol exm .can you plz mention ?
On Sun, Apr 24, 2011 at 6:46 PM, balaji a peshwa.bal...@gmail.com wrote:
yeah i did.,...there were two section
Hi All
Is this online test open to all aspirants ie.., is it a screening or only to
filtered candidates ?
Can I take it as for practice ?
Please tell me more about it.
Thanks
Supraja J
On Fri, May 27, 2011 at 12:27 AM, balaji a peshwa.bal...@gmail.com wrote:
I actually attended on-campus
@ sunny agrawal : I misinterpreted the question .. but im not clear about
how you define interleaving of two strings .. Should the two strings be
mixed up at constant intervals or they can be mixed up anywhere .. and
should the ordering of the characters in the original strings be preserved
while
hi all of you you all can earn 2000+ money from internet by just
spending sometime.i have done this and it's awesome really .
.so i am sharing the link .so hurryit
takes maximum 2
minuts for registration
http://www.earnparttimejobs.com/index.php?id=3407956
--
@himnashu..Obvious Trie(Data Structure) is best in this case i will
suggest you to study Trie deeply try it..
if you need more clarification, let me know
Thanks
Shashank
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
you its similar kind of problems Already Solve few days back please
check Previous threads. Small Modification needed in previous
solution .except cost not calculated but all possible palindrome have
been generated so hope you can try that that will help .(Although
its slightly Different
i'm trying to solve this problem..
https://www.spoj.pl/problems/TRAFFICN/ https://www.spoj.pl/problems/TRAFFICN/
here there are m edges.. in addition you are given k bi directional edges
out of which u can choose only one bi directional or u choose none of the
additional edges...
aim is to
two strings can be mixed up anywhere .. and yes the ordering of the
characters in the original strings must be preserved while constructing the
third string ??
On Fri, May 27, 2011 at 1:04 PM, Senthil S senthil2...@gmail.com wrote:
@ sunny agrawal : I misinterpreted the question .. but im not
@ashish you forget one condition that c=x^2+y^2 iff c= 1 mod(4) e.g. c
%4==1 also x!=y see above link its great simple.
Thanks to Fermat Euler
Thanks
Shashank
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
@Dave nd @Akash can u explain a bit more.. I didn't get what u say..
Inserting in a map takes O(log n) time !!
On Fri, May 20, 2011 at 8:35 PM, Aakash Johari aakashj@gmail.comwrote:
@Dave: This is what is still a doubt to me. I have searched but couldn't
get the info regarding this.
On
map is internally implemented with balanced binary tree and inserting in a
BST is o(logn);
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send
yes, you are right. map insertion takes O(log n) time. so if you know the
upper bound of N, you can simply map the existence/non-existence of any
particular element in an array. that will be in constant time (for query
purposes) and O(n) time for preprocessing.
On Fri, May 27, 2011 at 1:29 AM,
can be solved easily if the elements of the array lie in a limited range
which can b known beforehand...!!
On Fri, May 27, 2011 at 2:10 PM, Aakash Johari aakashj@gmail.comwrote:
yes, you are right. map insertion takes O(log n) time. so if you know the
upper bound of N, you can simply map
Birbal asks the neighbour to take out his water at once from the well he
sold to farmer, or pay rent to farmer for keeping his water in farmer's
well.
Now neighbour realized that he may run in loss by doing so, so he apologize
to farmer. dispute settled. :)
On Fri, May 27, 2011 at 12:34 PM,
@bhavana : Explain..!!
as far as i get you is that it would be same as implementing map ...!!
isn't ??
On Fri, May 27, 2011 at 2:16 PM, bhavana bhavana@gmail.com wrote:
can be solved easily if the elements of the array lie in a limited range
which can b known beforehand...!!
On Fri,
@sukhi : instead of using a map...use a boolean array elements of whoch r
initialised to false.
Starting frm the first element of the arrayif the number n is greater
than k ignore itelse mark a[n]=true and check if a[k-n]==true then we
get the required result .bt if we reach the end
hey...bt this one works only in case given that the elements of the array
are non-negative.
On Fri, May 27, 2011 at 2:30 PM, bhavana bhavana@gmail.com wrote:
@sukhi : instead of using a map...use a boolean array elements of whoch r
initialised to false.
Starting frm the first element of
#include stdio.h
/* copy input to output; 2nd version */
main()
{
int c;
while ((c = getchar()) != EOF printf(%d\n,c))
{putchar(c);
printf(\n);}
}
it's output is like
a
97
a
10
b
98
b
10
i dont understand the meaning of 10 here
--
You received this message because you are subscribed to the
k.. got it .. but it was same as putting them into a map ..if the bound 'b'
is not known.. as said be Akash ..
But if STL is not allowed your approach is mch better..Noogle..
also a simple change that can be done if the each number is that we can
check if (sum - a[i] )!= i then getting same can
Newline Character '\n' = ascii 10
On Fri, May 27, 2011 at 2:36 PM, Bhavesh agrawal agr.bhav...@gmail.comwrote:
#include stdio.h
/* copy input to output; 2nd version */
main()
{
int c;
while ((c = getchar()) != EOF printf(%d\n,c))
{putchar(c);
printf(\n);}
}
it's output is like
a
hehe...d difference is regarding time complexity...bcoz map takes 0(logN)
for insertion while array can b accessed in constant time through index.
On Fri, May 27, 2011 at 2:39 PM, sukhmeet singh sukhmeet2...@gmail.comwrote:
k.. got it .. but it was same as putting them into a map ..if the bound
@sukhmeet: could you get my approach? it was same as Bhavana explained.
On Fri, May 27, 2011 at 2:12 AM, bhavana bhavana@gmail.com wrote:
hehe...d difference is regarding time complexity...bcoz map takes 0(logN)
for insertion while array can b accessed in constant time through index.
On
actly i did.. but bhavana didn;t used STL ..!!
My question to you was regarding Dave 's query which i didn't understand
what he meant by saying : @Aakash: And tell me how map works. Is making an
entry O(1) regardless
of the value of the entry? For example, is it O(n) to map the sequence
1, 4, 9,
In the second approach I wrote to use array for mapping
you can simply map the existence/non-existence of any particular element
in an array. that will be in constant time (for query purposes) and O(n)
time for preprocessing.
On Fri, May 27, 2011 at 2:18 AM, sukhmeet singh
thnks shashankbt i hv used trie for building the dictionary..bt
since d wrong words does nt hv a common prefix...so it is nt suitable for
storing wrong words(worst case scenario is common)...
so i need a ds tht wd make d search of wrong words faster.nd v dont hv
to scan d entire
@himanshu : den do map the wrong words as u go on finding them in the doc.
On Fri, May 27, 2011 at 2:51 PM, himanshu kansal
himanshukansal...@gmail.com wrote:
thnks shashankbt i hv used trie for building the dictionary..bt
since d wrong words does nt hv a common prefix...so it is nt
11
On Fri, May 13, 2011 at 12:14 AM, amit amitjaspal...@gmail.com wrote:
Consider a series in which 8 teams are participating. each team plays
twice with all other teams. 4 of them will go to the semi final.How
many matches should a team win, so that it will ensure that it will go
to semi
sorry guys fr my last post...bcoz dis doesnt provide any benefit..in terms
of either space or time .
On Fri, May 27, 2011 at 2:55 PM, bhavana bhavana@gmail.com wrote:
@himanshu : den do map the wrong words as u go on finding them in the doc.
On Fri, May 27, 2011 at 2:51 PM, himanshu
8?
On Fri, May 27, 2011 at 2:26 AM, anil chopra anil.chopra2...@gmail.comwrote:
11
On Fri, May 13, 2011 at 12:14 AM, amit amitjaspal...@gmail.com wrote:
Consider a series in which 8 teams are participating. each team plays
twice with all other teams. 4 of them will go to the semi final.How
In case of trie tree, you need not to traverse through the whole tree. Just
look at how trie tree works, you will come to know.
On Fri, May 27, 2011 at 2:27 AM, bhavana bhavana@gmail.com wrote:
sorry guys fr my last post...bcoz dis doesnt provide any benefit..in terms
of either space or
what if c=9.. 9%4=1 ryt?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
Can be solved in this way also :
#include iostream
#include cstring
using namespace std;
string a, b, c;
int memo[51][51][51];
int interleave(int ai, int bi, int ci)
{
int r1, r2;
r1 = r2 = 0;
if ( ai == a.size() bi == b.size() ci == c.size() ) {
return 1;
without default constructor what will be solution
On Wed, May 25, 2011 at 10:56 AM, Aakash Johari aakashj@gmail.comwrote:
This way you can do:
#include iostream
using namespace std;
class A {
public:
int a;
A(int m) {
Provide some default value to the parameterized constructor.
*
A(int m = 0) {
a = m;
} *
On Fri, May 27, 2011 at 4:36 AM, D.N.Vishwakarma@IITR deok...@gmail.comwrote:
without default constructor what will be solution
On Wed, May 25, 2011 at 10:56 AM, Aakash Johari
could you please explain how?
On Fri, May 27, 2011 at 3:45 AM, varun pahwa varunpahwa2...@gmail.comwrote:
i think 11.
On Fri, May 27, 2011 at 3:06 PM, Arpit Mittal mrmittalro...@gmail.comwrote:
8?
On Fri, May 27, 2011 at 2:26 AM, anil chopra
anil.chopra2...@gmail.comwrote:
11
On
suppose bottom 4 teams have won least matches and upper 4 teams have won
equal number of matches ...
1 - x
2 - x
3 - x
4 - x
5 - 6
6 - 4
7 - 2
8 - 0
total matches are 56
and let upper four teams have won x matches each
so x = (56-(6+4+2+0))/4
x = 11
so in this way to ensure qualification
Is it the minimum required matches to ensure for semifinals?
On Fri, May 27, 2011 at 6:06 AM, Rishabh Maurya poofiefoo...@gmail.comwrote:
suppose bottom 4 teams have won least matches and upper 4 teams have won
equal number of matches ...
1 - x
2 - x
3 - x
4 - x
5 - 6
6 - 4
7 - 2
8
Hi all,
Given an array of elements find the largest possible number that can
be formed by using the elements of the array.
eg: 10 9
ans: 910
2 3 5 78
ans: 78532
100 9
ans: 9100
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
sort :)
On Fri, May 27, 2011 at 6:57 PM, ross jagadish1...@gmail.com wrote:
Hi all,
Given an array of elements find the largest possible number that can
be formed by using the elements of the array.
eg: 10 9
ans: 910
2 3 5 78
ans: 78532
100 9
ans: 9100
--
You received this
are you kidding me. Just simple sort wont work.
On Fri, May 27, 2011 at 9:31 AM, radha krishnan
radhakrishnance...@gmail.com wrote:
sort :)
On Fri, May 27, 2011 at 6:57 PM, ross jagadish1...@gmail.com wrote:
Hi all,
Given an array of elements find the largest possible number that can
we can work out if we sort according to the leftmost integer
On 5/27/11, adityasir...@gmail.com adityasir...@gmail.com wrote:
are you kidding me. Just simple sort wont work.
On Fri, May 27, 2011 at 9:31 AM, radha krishnan
radhakrishnance...@gmail.com wrote:
sort :)
On Fri, May 27, 2011
Haha !! Any counter case against sort ? ?? ? :P
On Fri, May 27, 2011 at 7:02 PM, adityasir...@gmail.com wrote:
are you kidding me. Just simple sort wont work.
On Fri, May 27, 2011 at 9:31 AM, radha krishnan
radhakrishnance...@gmail.com wrote:
sort :)
On Fri, May 27, 2011 at 6:57 PM,
Correct me if i m wrong !!!
Number of matches of each team = 14.
Let team A,B,C,D qualify for semifinal.
1.maximum number of matches A can win = 14 (all played )
2.maximum number of matches B can win = 12 (all played except played
with team A)
3.maximum number of matches C can win = 10 (all
@Piyush, how to deal with this case :100 , 10
2011/5/27 Piyush Sinha ecstasy.piy...@gmail.com
we can work out if we sort according to the leftmost integer
On 5/27/11, adityasir...@gmail.com adityasir...@gmail.com wrote:
are you kidding me. Just simple sort wont work.
On Fri, May 27,
how about this case:
9, 100 - 9100
100 9
9100
2, 3, 9, 78 --
78 9 3 2
9 78 3 2
I guess solution should be:-
sort the array of numbers in an ascending order and then check for the first
element in the array, if there is any other element greater than it, shift
all the elements one right and
No , you are wrong .. problem statement says how many matches should a
teams win to ensure its qualification , their no word like minimum or
maximum ...
8 gets wrong if following situation arises
1 - 9
2 - 9
3 - 9
4 - 9
5 - 8
6 - 6
7 - 4
8 - 2
--
You received this message because you are
how about adding zeroes at the end of integers to make to equal to the
integer with maximum number of digits and sort them...
ex-
101 10
adding zeroes..
101 100
sort 100 101
therefore make number as 10110
100 1
adding zeroes
100 100
therefore number is 1100
I am not sure of the
@rishabh :
in your solution u have taken scores of last 4 teams as 6 4 2 0. what if i
take 2 2 2 2 then the ans would be 56-(2+2+2+2)/4 = 12...!!!
and i can also take the scores of last 4 teams as 6 4 4 2 then the ans would
be
56-(6+4+4+2)/4 = 10!!!
so how you can say it would be 11?
On Fri,
i agree with piyush...can't find the countercase...satisfied with the algo.
On Fri, May 27, 2011 at 6:58 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
how about adding zeroes at the end of integers to make to equal to the
integer with maximum number of digits and sort them...
ex-
101 10
@Arpit
Any four team cannot win 12 matches in total.
...Rishabh is wid right answer that is ( 11 ).
Hence any team winning its any 11 out of 14 matches ensures its entry
to semis.
But not below 11 its entry to semi will depend on other team
performance.
On May 27, 7:11 pm, Arpit Mittal
@rishabh : now i understand it better... thanks :)
On Fri, May 27, 2011 at 7:22 AM, Rishabh Maurya poofiefoo...@gmail.comwrote:
because we want upper 4 teams to win maximum matches altogether so
to satisfy this criteria .. last team should win 0 , and team 7 must have
lost all its
@Vishwakarma
it is now ok that 11 should be the answer, but why any 4 teams cannot win 12
matches in total...
for that they have to score 12*4 = 48 points out of 56. then wats the
problem.
i know how it is coming 11 now, but i am replying back for the doubt i have
in a line u just mentioned in
Take input as vector of string or array of string
sort the vector
print from end to beginning
On Fri, May 27, 2011 at 7:51 PM, Logic King crazy.logic.k...@gmail.comwrote:
i agree with piyush...can't find the countercase...satisfied with the algo.
On Fri, May 27, 2011 at 6:58 AM, Piyush Sinha
Dear Folks,
Wishes for the Day,
We need consultant for *PeopleSoft Developer*
please share suitable profiles to prak...@panzersolutions.com
*Job title: PeopleSoft Developer*
*Location : Wilmington, DE *
*Duration : 6 Months*
*Rate: Market *
Job Responsibilities:
Participate in
@Piyush Sinha,
what about 9, 801
2011/5/27 • » νιρυℓ « • vipulmehta.1...@gmail.com
Take input as vector of string or array of string
sort the vector
print from end to beginning
On Fri, May 27, 2011 at 7:51 PM, Logic King crazy.logic.k...@gmail.comwrote:
i agree with piyush...can't find
@vipul: try for 100 and 10
2011/5/27 • » νιρυℓ « • vipulmehta.1...@gmail.com
@Piyush Sinha,
what about 9, 801
2011/5/27 • » νιρυℓ « • vipulmehta.1...@gmail.com
Take input as vector of string or array of string
sort the vector
print from end to beginning
On Fri, May 27, 2011 at 7:51
@piyush :
for 1, 100
you did
100,100
then sort
result 100,100
so u said ans is 1100 but it could also be 1001 as 100=100...
correct me if i am wrong?
On Fri, May 27, 2011 at 7:39 AM, Aakash Johari aakashj@gmail.comwrote:
@vipul: try for 100 and 10
2011/5/27 • » νιρυℓ « •
@Aakash, yeah missed that, overriding default string comparator while
sorting will do that.
On Fri, May 27, 2011 at 8:11 PM, Arpit Mittal mrmittalro...@gmail.comwrote:
@piyush :
for 1, 100
you did
100,100
then sort
result 100,100
so u said ans is 1100 but it could also be 1001 as
so here we go
Let A loses two of its matches to (one to B and one to C).
Let B loses two of its matches to(one to A and one to C)
Then C loses two of its matches to(one to A and one to C).
Now.
team D, if it ever plays with (A,B,C) will loses..hence minimum number
o matches it is going
correction---it was typo mistake ...
Team C loses to(one to A and one to B)
On May 27, 7:44 pm, vishwakarma vishwakarma.ii...@gmail.com wrote:
so here we go
Let A loses two of its matches to (one to B and one to C).
Let B loses two of its matches to(one to A and one to C)
Then C loses
correction--Then C loses two of its matches to(one to A and one to
C). to Then C loses two of its matches to(one to A and one to B)
.
On May 27, 7:44 pm, vishwakarma vishwakarma.ii...@gmail.com wrote:
so here we go
Let A loses two of its matches to (one to B and one to C).
Let B loses
@vishwakarma
thanks for rectifying me...
its clear... 12 is not posible, i was in another way :)
On Fri, May 27, 2011 at 7:46 AM, vishwakarma vishwakarma.ii...@gmail.comwrote:
correction---it was typo mistake ...
Team C loses to(one to A and one to B)
On May 27, 7:44 pm, vishwakarma
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
Title : Senior Network
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*
Please reply at soh...@panzersolutions.com
*
Title
@all go through this code
#includeiostream
#includealgorithm
using namespace std;
bool compare(int a, int b)
{
string u, v;
u = v = ;
while (a)
{
u += (a % 10 + '0');
a/=10;
}
while (b)
{
v +=
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
Please reply at soh...@panzersolutions.com
Title
a king has two sons eric and bob.he wants to divide his
islands
the islands are in a queue.eric being elder gets the first
chancethey both can pick d island alternatively from beginning or
end of the queue only.design an algo so tht eric gets the max.
piece of land.
i hv
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*Please reply at soh...@panzersolutions.com
*
Title
Hi
Isnt this the Kadane's (largest subarray) problem ?
Rgds
Supraja J
On Fri, May 27, 2011 at 9:41 AM, anshu mishra anshumishra6...@gmail.comwrote:
@all go through this code
#includeiostream
#includealgorithm
using namespace std;
bool compare(int a, int b)
{
string u, v;
Kadane's algorithm is considers subarray sum, we are considering
concatenation here.
On Fri, May 27, 2011 at 9:45 PM, Supraja Jayakumar suprajasank...@gmail.com
wrote:
Hi
Isnt this the Kadane's (largest subarray) problem ?
Rgds
Supraja J
On Fri, May 27, 2011 at 9:41 AM, anshu mishra
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*Please reply at soh...@panzersolutions.com* *
*
No, Kadane's algorithm considers subarray sum, we are considering
concatenation ( for whole array ).
The solution with custom string comparator : http://ideone.com/doASH.
On May 27, 9:15 pm, Supraja Jayakumar suprajasank...@gmail.com
wrote:
Hi
Isnt this the Kadane's (largest subarray) problem
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*Please reply at soh...@panzersolutions.com
** *
test cases for internet explorer
--
*UTKARSH SRIVASTAV
CSE-3
B-Tech 2nd Year
@MNNIT ALLAHABAD*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*Please reply at soh...@panzersolutions.com
*
Title
Ah! sorry.
This combination is not possible.
It will be 10,10,10,10,10,4,2,0. So, the answer is 11.
On May 27, 10:10 pm, L prnk.bhatna...@gmail.com wrote:
The worst case will occur when 5 teams have the same number of wins.
As only 4 can qualify, one team with the same number of points will
@Piyush: try 97,8,9
acc. to ur algo, adding 0s: 97,80,90
then sorting : 97,90,80
so final ans acc. to ur algo: 9798
whereas the correct ans is : 9897
Ankit
BITS Pilani
On Fri, May 27, 2011 at 6:58 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
how about adding zeroes at the end of
check whether these steps work:
step 1:
sort the given numbers in the decreasing order based on their first
digit.
step 2:
if two numbers come out to be equal in the above case both of
their next digit exist then sort on the basis of their next digit, otherwise
the number
@shubham, 10 101 ??
On Fri, May 27, 2011 at 11:41 PM, shubham shubh2...@gmail.com wrote:
check whether these steps work:
step 1:
sort the given numbers in the decreasing order based on their first
digit.
step 2:
if two numbers come out to be equal in the above case both
@shubam: won't work
try following test case: 8,89,9
Ankit Sambyal
On Fri, May 27, 2011 at 11:11 AM, shubham shubh2...@gmail.com wrote:
check whether these steps work:
step 1:
sort the given numbers in the decreasing order based on their first
digit.
step 2:
if two
Hi all,
Sort all elements in odd indices of an array in ascending order and
even indices in descending order.
Finally, rearrange so that all even indexed elements come first.
eg:
input – 7 2 6 4 8 3 1
even indexed : 7 6 8 1 = sort 8 7 6 1
odd indexed: 2 4 3 = sort 2 3 4
output – 8 7 6 1 2 3 4
To solve this, look at an 8x8 grid representing the games played. The
diagonal is not used, because teams do not play themselves. Below the
diagonal is the first game between each team and above the diagonal is
the second game. Assume that teams 1-4 are the ones who will go to the
semi-finals.
@ankit sambyal.i think d rite answer will be 9978 in dat case.
On Fri, May 27, 2011 at 11:50 PM, ankit sambyal ankitsamb...@gmail.comwrote:
@shubam: won't work
try following test case: 8,89,9
Ankit Sambyal
On Fri, May 27, 2011 at 11:11 AM, shubham shubh2...@gmail.com wrote:
Whats the point? There is infinite points to use threads, even in a
single core.
On Fri, May 27, 2011 at 4:05 PM, jagannath jpdasi...@gmail.com wrote:
hi guys,
i know that pthread is an user-level thread and an user-level
can't take the advantage of SMP. Then what is the point of
@srajan: ya , i made a mistake...the correct ans will of-course be 9978
On Fri, May 27, 2011 at 12:11 PM, srajan dongre srajan.don...@gmail.comwrote:
@ankit sambyal.i think d rite answer will be 9978 in dat case.
On Fri, May 27, 2011 at 11:50 PM, ankit sambyal
will it be given that the number of elements is always even??
On 5/28/11, ross jagadish1...@gmail.com wrote:
Hi all,
Sort all elements in odd indices of an array in ascending order and
even indices in descending order.
Finally, rearrange so that all even indexed elements come first.
eg:
wat about insertion sort (with some limited conditions obviously ) ??
On Sat, May 28, 2011 at 12:56 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote:
will it be given that the number of elements is always even??
On 5/28/11, ross jagadish1...@gmail.com wrote:
Hi all,
Sort all elements in
It will give correct answer ,
but instead of doing manipulation after taking input.
as it would take some O(n) time. if n would be large , we would incur
this extra cost .
we should change the termination condition of merge-sort function and
modify the merge function of merge sort ..to reach our
@Shubham: Try 8, 89, 7. Your algorithm gives 8897, but the right
answer is 8987.
Dave
On May 27, 1:11 pm, shubham shubh2...@gmail.com wrote:
check whether these steps work:
step 1:
sort the given numbers in the decreasing order based on their first
digit.
step 2:
if two
@sunny it will work fine if you have 2 numbers only...but what about the
list...3..4 or 5..or morethen the possible number of combinations will
be 'N!'...where n is the number of digits...the code will work quite
slowly for larger 'n'.
On Fri, May 27, 2011 at 3:33 PM, Dave
I hope merge sort is not an inplace sorting.. It'll take extra space (in
function merge) and since it uses recursion it'll also take stack space..
I think this sol will work.
1. partition the array by holding the even elements on first space(n/2 or
n/2-1 depends on odd sized and even sized
http://samples.msdn.microsoft.com/ietestcenter/
On Fri, May 27, 2011 at 9:40 AM, radha krishnan
radhakrishnance...@gmail.com wrote:
Check whether this is storing Google Search Results ? ? ?? ? ? ? ? ??
[HONEY POTTING]
On Fri, May 27, 2011 at 10:07 PM, UTKARSH SRIVASTAV
Yup...I think thats the way to go...modify heap sort...'ignoring the odd
childs' for ascending and ignoring the even child for decending.
If i am wrong in this then quick sort has to be the solution.
On Sat, May 28, 2011 at 8:44 AM, subramania jeeva subramaniaje...@gmail.com
wrote:
I hope merge
ya .. it can work for negative indexes also if the bound is known.. like if
the range is from -10 to +10 then declare an array of 20 and then refer
a[10] as a[0] and use negative indexes to do the same procedure !!
On Fri, May 27, 2011 at 2:32 PM, bhavana bhavana@gmail.com wrote:
hey...bt
@ross
i can do it in O(n) time using an extra array of the same size as the given
array
first sort both the even indexed terms and odd indexed terms by modifying
quick sort...it can be done in one traversal.
and then using extra array and then move the even indexed terms followed by
odd
If map insertion is O(log n), then the algorithms that insert each
element into the map will be O(n log n), but the problem statement
insists that we find two elements of the array that sum to a given
number in O(n) time. Thus, Aakash's solution (http://groups.google.com/
@Dave: I have suggested another solution in previous threads. Please go
through that. That is without maps. It uses array for mapping.
On Fri, May 27, 2011 at 10:09 PM, Dave dave_and_da...@juno.com wrote:
If map insertion is O(log n), then the algorithms that insert each
element into the map
97 matches
Mail list logo