Re: [algogeeks] Re: Million Numbers

2011-06-09 Thread Vetri Balaji
@ankit: pls explain the time complexity.. i dont think its O(log n) On Thu, Jun 9, 2011 at 11:57 PM, ankit sambyal wrote: > @Dumanshu: In each iteration, we r removing the smallest number. If > at any iteration we can't find the next smallest no., it means that > no. is missing. > > > > On T

Re: [algogeeks] Re: SPOJ IMPORT

2011-06-09 Thread saurabh singh
look for overlapping subproblems.Most of such problems have a recursive solution possible with time complexity o(2^n) and using dp we can reduce the subproblems and get solution of order polynomial.Thats one way of recognizing dp problems. On Fri, Jun 10, 2011 at 11:14 AM, kartik sachan wrote: >

Re: [algogeeks] Re: SPOJ IMPORT

2011-06-09 Thread kartik sachan
how people think of DP?? can u tell me -- 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

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread hary rathor
just take glance at book java swing of o'reilly book you will your all answer -- 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 alg

Re: [algogeeks] Re: MS Interview

2011-06-09 Thread hary rathor
dumnanshu you should first mention memory size in your computer so that i could know that how many number i can have in main memory at time -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googl

Re: [algogeeks] C Question

2011-06-09 Thread rahul patil
On Thu, Jun 9, 2011 at 7:45 PM, ADITYA KUMAR wrote: > a volatile pointer to a volatile pointer to integer > > i think volatile pointer to a volatile pointer to integer can be written as int *volatile * volatile x it's **volatile x; i think its volatile pointer to pointer to integer. correct me

[algogeeks] Re: MS Q

2011-06-09 Thread ross
An algorithm is: Have a bit array B of 256/65k size. If an color 'i' is encountered in the solution, set its B[i]=1; Traverse the solution array S, if(S[i]==B[i]) hits++; else if ( B[S[i]] ) pseudohits++; On Jun 10, 9:40 am, Harshal wr

[algogeeks] Re: Puzzle

2011-06-09 Thread ross
@lalit: The idea here would be for Train T, make it cross its own parachute first. Then move both the train fwd until the trailing train reaches a parachute. When the trailing train reaches the parachute of the leading train, make it move faster than the leading train . Naturally the leading train

Re: [algogeeks] MS Q

2011-06-09 Thread Harshal
#include #include using namespace std; void mastermind(char* guess, char* sol, int *hits, int *pseudohits) { int temp[256] = {0}; int len1=strlen(sol); int len2=strlen(guess); while(--len1+1) (guess[len1]==sol[len1]) ? ((*hits)+=1,temp[len1] = 1) : (temp[sol[len1]] += 1); while(--le

Re: [algogeeks] Please explain this problem

2011-06-09 Thread keyan karthi
the nos can repeat :) ie the valid set may contain multiple instance of a same number.. hope this helps :) On Fri, Jun 10, 2011 at 9:31 AM, saurabh singh wrote: > Problem link- ABCDEF > > Can someone please explain this problem.The problem says a,b,c,d,e,

[algogeeks] Re: Please explain this problem

2011-06-09 Thread .bashrc
Ok got it...a,b,c,d,e,f need not be distinctSorry for bothering. On Jun 10, 9:01 am, saurabh singh wrote: > Problem link- ABCDEF > > Can someone please explain this problem.The problem says a,b,c,d,e,f belongs > to S.But what if size of S is smaller than

[algogeeks] Please explain this problem

2011-06-09 Thread saurabh singh
Problem link- ABCDEF Can someone please explain this problem.The problem says a,b,c,d,e,f belongs to S.But what if size of S is smaller than 6? I know i am missing sumthing very trivialhelp plz. -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD

Re: [algogeeks] Re: SPOJ IMPORT

2011-06-09 Thread saurabh singh
lol.Don't bother.I too have fallen for scan till EOF scheme On Fri, Jun 10, 2011 at 1:58 AM, kartik sachan wrote: > its done silly mistake...:( > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group

[algogeeks] MS Q

2011-06-09 Thread Piyush Sinha
Game of master mind: you have four balls, and four different colors, as a solution. The user tries to guess the solution. If they guess the right color for the right spot, it counts as a 'hit'. If it's the right color, but the wrong spot, it counts as a psuedo-hit. For example: if the solution is '

[algogeeks] Re: SPOJ IMPORT

2011-06-09 Thread kartik sachan
its done silly mistake...:( -- 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

Fwd: [algogeeks] Cisco Expert CCIE Engineer // Daytona Beach, FL // 3 weeks contract

2011-06-09 Thread shady
Job done guys. Lets hope the other guy leaves too. Shady. -- Forwarded message -- From: sohail Date: Thu, Jun 9, 2011 at 6:55 PM Subject: Re: [algogeeks] Cisco Expert CCIE Engineer // Daytona Beach, FL // 3 weeks contract To: shady Ok fine. - Original Message - *Fro

Re: [algogeeks] Interview Today!! Need SAP SCM-SD Consultant// Tampa, FL

2011-06-09 Thread shady
After Sohail Panzer you have started sending your mails to the group. Please leave this group. No one likes such kind of mails. On Thu, Jun 9, 2011 at 8:48 PM, Prakash recruiter < prakash.recruite...@gmail.com> wrote: > Dear Folks, > > Wishes for the Day, > We need consultant for *SAP SCM-SD Cons

[algogeeks] SPOJ IMPORT

2011-06-09 Thread kartik sachan
http://www.spoj.pl/problems/IMPORT/ my code is # include float max(float [],int); void search(float [],char [],int ,float); int p; int main() { int t; scanf("%d",&t); int i; char ch[30]={0}; char a[30]={0}; float b[30]={0}; char f; for(i=0;ich[i]) p=i; printf("Import from %c\n",ch[p

[algogeeks] Puzzle

2011-06-09 Thread LALIT SHARMA
A helicopter drops two trains, each on a parachute, onto a straight infinite railway line. There is an undefined distance between the two trains. Each faces the same direction, and upon landing, the parachute attached to each train falls to the ground next to the train and detaches. Each train has

[algogeeks] Re: Million Numbers

2011-06-09 Thread Don
Create a range tree, pruning out as needed to stay in the memory constraint. Don On Jun 9, 6:24 am, Dumanshu wrote: > Given a file containing roughly 300 million social security numbers(9- > digit numbers) find a 9-digit number that isnt there in the file. You > have unlimited drive space but on

Re: [algogeeks] Re: Million Numbers

2011-06-09 Thread ankit sambyal
@Dumanshu: In each iteration, we r removing the smallest number. If at any iteration we can't find the next smallest no., it means that no. is missing. On Thu, Jun 9, 2011 at 10:54 AM, Dumanshu wrote: > hey... we have 300 million (9- digit) numbers. So we have to print a > number which isn

[algogeeks] Re: Million Numbers

2011-06-09 Thread Dumanshu
hey... we have 300 million (9- digit) numbers. So we have to print a number which isn't already there in the file. We are not given that number beforehand. You are saying to check "u are going to check whether a number N exist ". On Jun 9, 4:46 pm, radha krishnan wrote: > Ma approach is to xor th

Re: [algogeeks] Million Numbers

2011-06-09 Thread ankit sambyal
here is my approach : STEP 1: 300 million integers take 300*10^6*4 bytes of memory, but we have only 2 MB RAM which 2*10^6. By dividing these, we get that we need to break the file containing sequence of 300 million numbers into around 600 files. Divide the bigger file into 600 smaller files. STE

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread shashankreddy509
74658 is the answer. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/tk1YfCtLvWkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsub

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread shashankreddy509
@halo:have a look at the following link. http://zetcode.com/tutorials/javaswingtutorial/ http://www.javabeginner.com/java-swing/java-swing-tutorial u can get more information about the swings applications in this links. -- You received this message because you are subscribed to the Google Group

Re: [algogeeks] C Question

2011-06-09 Thread shashankreddy509
@Aditya:- can u give a brief intro of volatile pointer. Thanks. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/SJkBkvK-MqAJ. To post to this group, send e

Re: [algogeeks] MS interview question

2011-06-09 Thread Rohit Sindhu
I this this code will solves it ... *#include #include struct node{ int val; struct node *next; }; int main(){ struct node *head = NULL , *next_ptr = head; int n = 1; while ( n <= 6 ){ struct node *temp = (struct node*) malloc (sizeof(struct node) ); temp-

[algogeeks] Re: Need to compare large and adhoc files in Java

2011-06-09 Thread vishnu madiga
Cant see my mail going out On Fri, Jun 10, 2011 at 12:26 AM, vishnu madiga wrote: > > > > > Need to compare large and adhoc files (the files may have 1 milliion rows) > in java. > So need to load these files in a datastructure and based on a set of rules > , need to realign and compare these rows

[algogeeks] Need to compare large and adhoc files in Java

2011-06-09 Thread vishnu madiga
Need to compare large and adhoc files (the files may have 1 milliion rows) in java. So need to load these files in a datastructure and based on a set of rules , need to realign and compare these rows. Can you advice which datastructure/Collection class is best fit. Or anyway I need to custom code t

[algogeeks] Interview Today!! Need SAP SCM-SD Consultant// Tampa, FL

2011-06-09 Thread Prakash recruiter
Dear Folks, Wishes for the Day, We need consultant for *SAP SCM-SD Consultant* please share suitable profiles to prak...@panzersolutions.com *Title: SAP SCM-SD Consultant* *Location : Tampa, FL * *Duration : 6 months+* *Rate : Market* *NOTE: Interview Today* *.Start ASAP!

[algogeeks] Java DataStructure advice needed - Need to compare large and adhoc files (the files may have 1 milliion rows)

2011-06-09 Thread vishnu madiga
Need to compare large and adhoc files (the files may have 1 milliion rows) in java. So need to load these files in a datastructure and based on a set of rules , need to realign and compare these rows. Can you advice which datastructure/Collection class is best fit. Or anyway I need to custom code t

[algogeeks] Java DataStructure advice needed - Need to compare large and adhoc files (the files may have 1 milliion rows)

2011-06-09 Thread vishnu madiga
Need to compare large and adhoc files (the files may have 1 milliion rows) in java. So need to load these files in a datastructure and based on a set of rules , need to realign and compare these rows. Can you advice which datastructure/Collection class is best fit. Or anyway I need to custom code t

Re: [algogeeks] solve the series

2011-06-09 Thread tech rascal
awesome ..:) On Thu, Jun 9, 2011 at 7:45 PM, bhavana wrote: > @sunny : if dats d answer...hats off to u man !!! ...seriously awesum > thinking !! > > > On Thu, Jun 9, 2011 at 7:01 PM, nicks wrote: > >> gr8 man.awesome :) >> >> >> On Thu, Jun 9, 2011 at 6:00 AM, sunny agrawal wrote: >> >>> s

Re: [algogeeks] C Question

2011-06-09 Thread ADITYA KUMAR
a volatile pointer to a volatile pointer to integer int *volatile *p; a pointer to a volatile pointer to interger On Wed, Jun 8, 2011 at 11:28 AM, Vishal Thanki wrote: > Following declaration makes the "x" as a volatile pointer to an integer. > > int *volatile x; > > But what does following mean

Re: [algogeeks] solve the series

2011-06-09 Thread bhavana
@sunny : if dats d answer...hats off to u man !!! ...seriously awesum thinking !! On Thu, Jun 9, 2011 at 7:01 PM, nicks wrote: > gr8 man.awesome :) > > > On Thu, Jun 9, 2011 at 6:00 AM, sunny agrawal wrote: > >> seems like got it.. >> there is 150 days difference between 20/6(20 june) an

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread snehi jain
hey Karan... thanks a lot the links are helpful :) its an app. that can help in building one's vocab. its basically a thought right now. Will ask more when things start taking desired shape a little bit. On Thu, Jun 9, 2011 at 4:59 PM, karan sachan wrote: > Hi Snehi...Follow following links to k

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Anantha Krishnan
Hello, Here is the code : #include int mergeandcountinversion(int a[],int begin,int middle,int end,int z) { int length=end-begin+1; int tmp[length]; int i1=begin,i2=middle+1,it=0,i=0; for(i=0;imiddle) { for(;i2<=end;i2++) { tmp[it]=a[i2]; it++; } break; } if(i2>end) { for(;i1<=middle;i1++)

Re: [algogeeks] solve the series

2011-06-09 Thread nicks
gr8 man.awesome :) On Thu, Jun 9, 2011 at 6:00 AM, sunny agrawal wrote: > seems like got it.. > there is 150 days difference between 20/6(20 june) and 18/11(18 November) > > > On Thu, Jun 9, 2011 at 6:14 PM, sunny agrawal wrote: > >> ha ha . >> i answer randomly...:) >> i don't like s

Re: [algogeeks] solve the series

2011-06-09 Thread sunny agrawal
seems like got it.. there is 150 days difference between 20/6(20 june) and 18/11(18 November) On Thu, Jun 9, 2011 at 6:14 PM, sunny agrawal wrote: > ha ha . > i answer randomly...:) > i don't like series questions, but this thread was sleeping so i posted for > fun :) > if this is right a

Re: [algogeeks] Re: MS Interview

2011-06-09 Thread Freak Algo
Is not it O(n)? --- On Thu, 9/6/11, ankit arun wrote: From: ankit arun Subject: [algogeeks] Re: MS Interview To: "Algorithm Geeks" Date: Thursday, 9 June, 2011, 11:49 AM part 1 can be solved in O(1) complexity.. first adding all the numbers and then subtracting it from 4,000,000,000 will giv

Re: [algogeeks] Please Ban Sohail

2011-06-09 Thread Arpit Sood
+1 On Thu, Jun 9, 2011 at 3:10 PM, Naveen Kumar wrote: > Hi Moderators, > Can you please Ban Sohail from algogeeks? > We are receiving a lot of spams from him. > sohail.panz...@gmail.com > > -- > Cheers > Naveen Kumar > > -- > You received this message because you are subscribed to the Google Gro

Re: [algogeeks] solve the series

2011-06-09 Thread sunny agrawal
ha ha . i answer randomly...:) i don't like series questions, but this thread was sleeping so i posted for fun :) if this is right answer, lets try to think what was the author thinking while forming such series On Thu, Jun 9, 2011 at 6:03 PM, tech rascal wrote: > answer is 6 only bt I don't

Re: [algogeeks] solve the series

2011-06-09 Thread tech rascal
answer is 6 only bt I don't knw the logic On Thu, Jun 9, 2011 at 5:59 PM, Arpit Sood wrote: > @sunny since PRG's are also not absolutely random, then did you actually > generate series of the form 20 6 150 18 11, or you just answered it > randomly, :D > > @tech rascal > what's the actual answer

Re: [algogeeks] solve the series

2011-06-09 Thread Arpit Sood
@sunny since PRG's are also not absolutely random, then did you actually generate series of the form 20 6 150 18 11, or you just answered it randomly, :D @tech rascal what's the actual answer ? On Thu, Jun 9, 2011 at 5:46 PM, sunny agrawal wrote: > hehe > that was also random. :D > > -- > Yo

Re: [algogeeks] solve the series

2011-06-09 Thread sunny agrawal
hehe that was also random. :D -- 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

Re: [algogeeks] solve the series

2011-06-09 Thread tech rascal
so y did u give answer as 6 if it can b ny random no.?? xplain On Thu, Jun 9, 2011 at 12:31 PM, sunny agrawal wrote: > series of some random numbers generated ussing some RNG > no logic :P :P :P > > > > > On Thu, Jun 9, 2011 at 12:29 PM, Arpit Sood wrote: > >> hey, >>what's the logic ? >

Re: [algogeeks] logic error:

2011-06-09 Thread John Hayes
OMG..i'm such an idiot.thanks sunny :) On Thu, Jun 9, 2011 at 4:47 AM, sunny agrawal wrote: > check your this if condition > > if(tmap.end()->second=4) > { > ans=tmap.end()->first; > } > > it should be == , not = > > On Thu, Jun 9, 2011 at 5:09 PM, John Hayes wrote: > >

[algogeeks] Re: MS Interview

2011-06-09 Thread ankit arun
part 1 can be solved in O(1) complexity.. first adding all the numbers and then subtracting it from 4,000,000,000 will give the result. On Jun 9, 2:45 pm, Dumanshu wrote: > Q1. I  have a file in which there are supposed to be 4 billion > numbers, > starting from 1 to 4,000,000,000 but unfortunate

Re: [algogeeks] Regular Expressions Implementation

2011-06-09 Thread Freak Algo
Hi Navneet, Can you elaborate more? I could not follow you. Thanks. --- On Thu, 9/6/11, Navneet Gupta wrote: From: Navneet Gupta Subject: Re: [algogeeks] Regular Expressions Implementation To: algogeeks@googlegroups.com Date: Thursday, 9 June, 2011, 9:26 AM So i assume your ask is given a st

Re: [algogeeks] logic error:

2011-06-09 Thread sunny agrawal
check your this if condition if(tmap.end()->second=4) { ans=tmap.end()->first; } it should be == , not = On Thu, Jun 9, 2011 at 5:09 PM, John Hayes wrote: > Hello every one i tried to code the same problem using STL mapsbut > getting the RUN TIME ERROR > plz help in co

Re: [algogeeks] Million Numbers

2011-06-09 Thread radha krishnan
Ma approach is to xor the given number with all numbers in the file !! This takes O(n) I think we cant achieve a complexity wrote: > Given a file containing roughly 300 million social security numbers(9- > digit numbers) find a 9-digit number that isnt there in the file. You > have unlimited driv

Re: [algogeeks] Digest for algogeeks@googlegroups.com - 25 Messages in 7 Topics

2011-06-09 Thread ankit arun
On Thu, Jun 9, 2011 at 5:01 PM, wrote: > Today's Topic Summary > > Group: http://groups.google.com/group/algogeeks/topics > >- need help in Desktop applications <#130742ba4deca0ba_group_thread_0>[1 > Update] >- MS Interview <#130742ba4deca0ba_group_thread_1> [13 Updates] >- Million

Re: [algogeeks] logic error:

2011-06-09 Thread John Hayes
Hello every one i tried to code the same problem using STL mapsbut getting the RUN TIME ERROR plz help in correcting my code #include #include #include #include #include using namespace std; int main() { int tc,i,t1,t2; string s1,s2,ans; map tmap; scanf("%d",&tc); while(tc--) { fo

[algogeeks] Million Numbers

2011-06-09 Thread Dumanshu
Given a file containing roughly 300 million social security numbers(9- digit numbers) find a 9-digit number that isnt there in the file. You have unlimited drive space but only 2mb of RAM. Solution is as follows: In the first step, we build an array of 2^16 integers that is initialized to 0 and fo

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread karan sachan
Hi Snehi...Follow following links to kick-start your Swing!! http://www.herongyang.com/Swing/Introduction-First-Swing-Program-SwingHello.html http://www.dreamincode.net/forums/topic/206319-first-swing-application/

Re: [algogeeks] Re: MS Interview

2011-06-09 Thread Piyush Sinha
Xoring it twice ...once with the elements in the file and then from i=1 to 4,000,000,000..the answer left is the missing number On Thu, Jun 9, 2011 at 4:46 PM, Dumanshu wrote: > I dont think numbers are sorted in the 1st question. btw > @sunny: how will xor-ing give the ans? for 1st ques? > > On

RE: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
Ohh. Missed out the nlogn condition you mentioned. It will do but in n^2 Sent from my Windows Phone -- From: D.N.Vishwakarma@IITR Sent: Thursday, 9 June 2011 4:29 PM To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Finding total number of inversions in an array

[algogeeks] Re: MS Interview

2011-06-09 Thread Dumanshu
I dont think numbers are sorted in the 1st question. btw @sunny: how will xor-ing give the ans? for 1st ques? On Jun 9, 3:34 pm, sunny agrawal wrote: > yes, but using xor no need of ULL :) > > 2011/6/9 • » νιρυℓ « • > > > > > > > > > > > Sum wont overflow, ULL range will include sum. > > > On Th

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread D.N.Vishwakarma@IITR
how insertion sort will do in O(nlogn)? On Thu, Jun 9, 2011 at 4:27 PM, Navneet Gupta wrote: > Insertion sort also would do. > > On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR > wrote: > > thanx for suggestion > > > > On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal > > wrote: > >> > >> Dis

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread Navneet Gupta
Insertion sort also would do. On Thu, Jun 9, 2011 at 4:22 PM, D.N.Vishwakarma@IITR wrote: > thanx for suggestion > > On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal > wrote: >> >> Discussed many times, >> 1) add some lines to merge sort >> 2) use Binary indexed tree for a faster version (i have no

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread D.N.Vishwakarma@IITR
thanx for suggestion On Thu, Jun 9, 2011 at 4:08 PM, sunny agrawal wrote: > Discussed many times, > 1) add some lines to merge sort > 2) use Binary indexed tree for a faster version (i have not tried but get > to know it can be done using binary indexed tree) > > On Thu, Jun 9, 2011 at 4:05 PM, D

Re: [algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread sunny agrawal
Discussed many times, 1) add some lines to merge sort 2) use Binary indexed tree for a faster version (i have not tried but get to know it can be done using binary indexed tree) On Thu, Jun 9, 2011 at 4:05 PM, D.N.Vishwakarma@IITR wrote: > Inversion means pair(i,j) such that iA[j] > > -- > **With

[algogeeks] Finding total number of inversions in an array in O(nlogn) complexity .

2011-06-09 Thread D.N.Vishwakarma@IITR
Inversion means pair(i,j) such that iA[j] -- **With Regards Deoki Nandan Vishwakarma IITR MCA * * -- 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 grou

Re: [algogeeks] MS Interview

2011-06-09 Thread sunny agrawal
yes, but using xor no need of ULL :) 2011/6/9 • » νιρυℓ « • > Sum wont overflow, ULL range will include sum. > > On Thu, Jun 9, 2011 at 3:52 PM, sunny agrawal wrote: > >> sum can overflow >> Xor method can also be applied to Q1. no need of numbers to be sorted. >> >> 2011/6/9 • » νιρυℓ « •

Re: [algogeeks] MS Interview

2011-06-09 Thread • » νιρυℓ « •
Sum wont overflow, ULL range will include sum. On Thu, Jun 9, 2011 at 3:52 PM, sunny agrawal wrote: > sum can overflow > Xor method can also be applied to Q1. no need of numbers to be sorted. > > 2011/6/9 • » νιρυℓ « • > >> For 1. >> sum the numbers in the file, subtract it from sum of first

Re: [algogeeks] MS Interview

2011-06-09 Thread sunny agrawal
sum can overflow Xor method can also be applied to Q1. no need of numbers to be sorted. 2011/6/9 • » νιρυℓ « • > For 1. > sum the numbers in the file, subtract it from sum of first 4 billion > numbers. > > > On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta wrote: > >> The answer to second quest

Re: [algogeeks] MS Interview

2011-06-09 Thread Naveen Kumar
I think numbers in question1 are in sequence (ascending order). 2011/6/9 • » νιρυℓ « • > For 1. > sum the numbers in the file, subtract it from sum of first 4 billion > numbers. > > > On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta wrote: > >> The answer to second question is simple. XORing all th

Re: [algogeeks] MS Interview

2011-06-09 Thread • » νιρυℓ « •
For 1. sum the numbers in the file, subtract it from sum of first 4 billion numbers. On Thu, Jun 9, 2011 at 3:44 PM, Navneet Gupta wrote: > The answer to second question is simple. XORing all the elements > should do it for you. > > > On Thu, Jun 9, 2011 at 3:15 PM, Dumanshu wrote: > > Q1. I h

[algogeeks] MS Interview

2011-06-09 Thread Dumanshu
Q1. I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing, i.e there are only 3,999,999,999 numbers, I need to find the missing number. Q2. I have an array consisting of 2n+1 elements. n elements in it are mar

Re: [algogeeks] MS Interview

2011-06-09 Thread varun pahwa
2nd part can be done just take the xor of all the numbers same number xor returns 0 so only seven will remain. 1st part can be done in O(n) because estimate sum -> n*(n+1)/2. now sub from estimated sum each array element. the last value remained is the missing number. correct me if i am wrong. On

Re: [algogeeks] MS Interview

2011-06-09 Thread Navneet Gupta
The answer to second question is simple. XORing all the elements should do it for you. On Thu, Jun 9, 2011 at 3:15 PM, Dumanshu wrote: > Q1. I  have a file in which there are supposed to be 4 billion > numbers, > starting from 1 to 4,000,000,000 but unfortunately one number is > missing, > i.e t

Re: [algogeeks] MS Interview

2011-06-09 Thread Ershad K
On Thursday 09 June 2011 09:59 AM, Ershad K wrote: On Thursday 09 June 2011 03:15 PM, Dumanshu wrote: Q1. I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing, i.e there are only 3,999,999,999 numbers, I need

Re: [algogeeks] MS Interview

2011-06-09 Thread Freak Algo
For Q2 "Bitwise X-OR" operation of all input numbers does the trick. --- On Thu, 9/6/11, Dumanshu wrote: From: Dumanshu Subject: [algogeeks] MS Interview To: "Algorithm Geeks" Date: Thursday, 9 June, 2011, 9:45 AM Q1. I  have a file in which there are supposed to be 4 billion numbers, starti

Re: [algogeeks] MS Interview

2011-06-09 Thread Ershad K
On Thursday 09 June 2011 03:15 PM, Dumanshu wrote: Q1. I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing, i.e there are only 3,999,999,999 numbers, I need to find the missing number. Is the array sorted?

[algogeeks] Please Ban Sohail

2011-06-09 Thread Naveen Kumar
Hi Moderators, Can you please Ban Sohail from algogeeks? We are receiving a lot of spams from him. sohail.panz...@gmail.com -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeek

Re: [algogeeks] Regular Expressions Implementation

2011-06-09 Thread Navneet Gupta
So i assume your ask is given a string, check if it can be formed with the regular expression you have. Is that correct? The above can be implemented easily with stacks. Ex - Reg Expression - a*bc* And String - aabccc Put all instances of char that are consecutive on the stack and then pop the to

[algogeeks] Regular Expressions Implementation

2011-06-09 Thread Freak Algo
Hi All, How to implement the regular expressions in C language? I am looking for a generalized algorithm. Thanks, Ravi. -- 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 uns

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread nicks
Simple Problem :( On Thu, Jun 9, 2011 at 1:28 AM, snehi jain wrote: > 7 4 6 5 8 > > On Thu, Jun 9, 2011 at 1:48 PM, Naveen Kumar > wrote: > >> 7 4 6 5 8 >> >> On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat wrote: >> >>> *Secret Code puzzle >>> * >>> * >>> * >>> ** >>> *A man wanted to get into

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread amit kumar
74658 On Thu, Jun 9, 2011 at 1:58 PM, snehi jain wrote: > 7 4 6 5 8 > > On Thu, Jun 9, 2011 at 1:48 PM, Naveen Kumar > wrote: > >> 7 4 6 5 8 >> >> On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat wrote: >> >>> *Secret Code puzzle >>> * >>> * >>> * >>> ** >>> *A man wanted to get into his work buil

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread snehi jain
i Did that before asking for help on the group. anyways thanks :) Swing isnt necessary, someone referred so i am trying to learn it. Any info regarding desktop or phone apps. will be appreciated. On Thu, Jun 9, 2011 at 2:00 PM, Navneet Gupta wrote: > As soon as i type "Java Swing PDFs in google"

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread Navneet Gupta
As soon as i type "Java Swing PDFs in google", i get lots of results. See if anyone of them can help you. No tutorial i am having as such specifically for Swing. On Thu, Jun 9, 2011 at 1:53 PM, snehi jain wrote: > @naveen Thanks for the prompt reply > I am already aware of Applets and AWT and ha

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread snehi jain
@naveen Thanks for the prompt reply I am already aware of Applets and AWT and have started getting acquainted to Swing but the problem lies where to start from. Its like I want a small example or few starting steps. Complete Reference is the book that i refer. On Thu, Jun 9, 2011 at 1:48 PM, Navn

[algogeeks] Re : previous mail

2011-06-09 Thread shady
Lavesh , Sorry it wasn't meant for you. Apologies ! -- 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...@googlegr

Fwd: [algogeeks] Cisco Expert CCIE Engineer // Daytona Beach, FL // 3 weeks contract

2011-06-09 Thread shady
Sir, Currently i am not the only one who is having problem with your posts. If you look at the archives you will see, there are lot of people who consider you as a spammer. And this group is related to algorithms... this is not a mailing list for hiring people. Please leave this group, no one likes

Fwd: [algogeeks] Cisco Expert CCIE Engineer // Daytona Beach, FL // 3 weeks contract

2011-06-09 Thread shady
Sir, Currently i am not the only one who is having problem with your posts. If you look at the archives you will see, there are lot of people who consider you as a spammer. And this group is related to algorithms... this is not a mailing list for hiring people. Please leave this group, no one likes

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread Naveen Kumar
7 4 6 5 8 On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat wrote: > *Secret Code puzzle > * > * > * > ** > *A man wanted to get into his work building, but he had forgotten his > code. However, he did remember five clues. These are what those clues were: > > The fifth number plus the third number eq

Re: [algogeeks] need help in Desktop applications

2011-06-09 Thread Navneet Gupta
I would recommend you to read complete Java Reference book by Herbert Schildt, it will take you nicely through the basics of creating window based applications. First read the chapters on Applets and AWT and then you should be able to easily and naturally graduate to using Swing. On Thu, Jun 9, 2

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread balaji a
7 4 6 5 8 On 9 Jun 2011 13:37, "Lavesh Rawat" wrote: *Secret Code puzzle * * * ** *A man wanted to get into his work building, but he had forgotten his code. However, he did remember five clues. These are what those clues were: The fifth number plus the third number equals fourteen. The fourth

Re: [algogeeks] [brain teaser ] Secret Code puzzle 9 june

2011-06-09 Thread • » νιρυℓ « •
74658 On Thu, Jun 9, 2011 at 1:36 PM, Lavesh Rawat wrote: > *Secret Code puzzle > * > * > * > ** > *A man wanted to get into his work building, but he had forgotten his > code. However, he did remember five clues. These are what those clues were: > > The fifth number plus the third number equals

[algogeeks] need help in Desktop applications

2011-06-09 Thread snehi jain
hi, I am trying to create a Desktop application in JAVA and somebody referred JAVA swing for designing such apps. i need help in creating one. If Anybody has any knowledge or is aware of links or pdfs then please reply. Thanks -- You received this message because you are subscribed to the Goo

Re: [algogeeks] solve the series

2011-06-09 Thread Arpit Sood
hey, what's the logic ? On Thu, Jun 9, 2011 at 12:22 PM, sunny agrawal wrote: > 6 > > > On Wed, Jun 8, 2011 at 10:31 PM, tech rascal wrote: > >> 20 ? 150 18 11 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to th

Re: [algogeeks] Re: please help me

2011-06-09 Thread Navneet Gupta
Try placementsindia.blogspot.com , it has a good collection of problems specific to placements. On Thu, Jun 9, 2011 at 12:23 PM, coder dumca wrote: > I need some more books specialy on algo ds and puzzles > > On Wed, Jun 8, 2011 at 4:07 AM, coder dumca wrote: >> >> I am last year  student prepar

Re: [algogeeks] FOR ALL INDIANS PLZ READ IT

2011-06-09 Thread Naveen Kumar
There is no such condition put up by the govt. If you give a missed call you are showing your support to Anna Hazare Please read http://theindiapost.com/delhi/support-hazare-give-call-02261550789/ On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff wrote: > did u try it ?? > nd did u get the m

[algogeeks] Re: please help me

2011-06-09 Thread coder dumca
I need some more books specialy on algo ds and puzzles On Wed, Jun 8, 2011 at 4:07 AM, coder dumca wrote: > I am last year student preparing for placements > > can any one give some ebooks on data structure, algo etc. like beofre > some time , some one posted a book " how to crack the coding

Re: [algogeeks] FOR ALL INDIANS PLZ READ IT

2011-06-09 Thread coder dumca
wow it's working ... On Wed, Jun 8, 2011 at 11:49 PM, sunny agrawal wrote: > yup, it works, i tried it!! > > > On Thu, Jun 9, 2011 at 12:15 PM, Abdul Rahman Shariff > wrote: > >> did u try it ?? >> nd did u get the msg?? >> >> On Thu, Jun 9, 2011 at 1:06 AM, kartik sachan wrote:

Re: [algogeeks] solve the series

2011-06-09 Thread sunny agrawal
series of some random numbers generated ussing some RNG no logic :P :P :P On Thu, Jun 9, 2011 at 12:29 PM, Arpit Sood wrote: > hey, >what's the logic ? > > On Thu, Jun 9, 2011 at 12:22 PM, sunny agrawal wrote: > >> 6 >> >> >> On Wed, Jun 8, 2011 at 10:31 PM, tech rascal wrote: >> >>> 2