Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-21 Thread pankaj agarwal
@Nitin Garg Question 6 - i agree that greater the sum is and greater the probability to getting it. but in given question if sum100 then rolling is stopped so for P(106)=P(100)*1/6 P(105)=P(100)*1/6+P(99)*1/6 . . . P(101)=P(100)*1/6+P(99)*(1/6)+P(98)*(1/6)+P(97)*(1/6)+..+P(95)*(1/6) now P(101)

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-21 Thread Nitin Garg
Ohh i totally missed that line. Thanx a lot :) On Wed, Sep 21, 2011 at 10:46 AM, pankaj agarwal agarwal.pankaj.1...@gmail.com wrote: @Nitin Garg Question 6 - i agree that greater the sum is and greater the probability to getting it. but in given question if sum100 then rolling is stopped

Re: [algogeeks] Segmentation fault with vfork

2011-09-21 Thread SREENU NAIK
hi it gives that in fun1:incompatible implicit declaration of built-in function ‘printf’ in fun2:incompatible implicit declaration of built-in function ‘printf’ On Wed, Sep 21, 2011 at 7:37 AM, saurabh singh saurab...@gmail.com wrote: #includesys/types.h int fun1() {

Re: [algogeeks] Amazon SDE onsite interview question

2011-09-21 Thread bharatkumar bagana
@anush: we should look at all descendants and ancestors. .. but u 'r looking at pars In our structure we should have a parent pointer .. and we should look at all our descendants --- takes O(n) time .. correct me if I'm wrong ... On Tue, Sep 20, 2011 at 10:54 AM, anshu mishra

Re: [algogeeks] Re: What is the time to get min element from the binary max heap !!

2011-09-21 Thread anshu mishra
If we know the size of heap we can get the minimum element in O(n); int findMinFromMaxHeap(int ar[], int n) { if ( (n+1) n == 0) { for (i = n1; i n; i++) min = min ar[i] ? ar[i] : min; } else { int x = n, y = 1;

[algogeeks] BST

2011-09-21 Thread prasanth n
Given a binary search tree, design an algorithm which creates a linked list of all the nodes at each depth (i.e., if you have a tree with depth D, you’ll have D linked lists). -- *prasanth* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] Amazon SDE onsite interview question

2011-09-21 Thread anshu mishra
explanation: Node : lock - that node is locked or not; lockedDesc - number of descendents locked of that node left, right,par as name sugest; unLock(): when we unlock a node than all its ancestor has to decrease its lockedDesc value by 1. Lock(): when we lock a node than all its ancestor has to

Re: [algogeeks] Segmentation fault with vfork

2011-09-21 Thread sukran dhawan
@sreeu :lol #includestdio.h? :P include this header file:P That s not saurabh s question On Wed, Sep 21, 2011 at 4:51 PM, SREENU NAIK srinivasulunai...@gmail.comwrote: hi it gives that in fun1:incompatible implicit declaration of built-in function ‘printf’ in fun2:incompatible implicit

[algogeeks] Pythagorean Triplets

2011-09-21 Thread ranjeet srivastava
Hey can anyone suggest any good algorithm for finding out first n pythagorean triplets? Thank You -- *R.K.SRIV@ST@V@* -- 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

Re: [algogeeks] Segmentation fault with vfork

2011-09-21 Thread Azhar Hussain
Read this documentation http://pubs.opengroup.org/onlinepubs/7908799/xsh/vfork.html vfork creates read-only copy of the parent. You cannot call function or assign value to variable except pid_t. Use fork and it should succeed. PS: Please ask questions related to Algorithms, as it is algorithm

Re: [algogeeks] BST

2011-09-21 Thread saurabh agrawal
Do a BFS of the tree, keep a separator to masrk where a level ends.. create the linklist for every level. On Wed, Sep 21, 2011 at 6:00 PM, prasanth n nprasnt...@gmail.com wrote: Given a binary search tree, design an algorithm which creates a linked list of all the nodes at each depth (i.e., if

[algogeeks] tree to list

2011-09-21 Thread prasanth n
anyone give an algorithm of how to convert a binary search tree into a linkedlist -- *prasanth* -- 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,

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
IT is not the case ... I already said acc to ANSI c result is undefined !! not 0 by dault On Wed, Sep 21, 2011 at 6:50 PM, kartik sachan kartik.sac...@gmail.comwrote: ans in both cases is zero i think if return is written and nthg specified value is given it will return by default

Re: [algogeeks] tree to list

2011-09-21 Thread sukran dhawan
do BFS search,at each level make a linked list On Wed, Sep 21, 2011 at 6:50 PM, prasanth n nprasnt...@gmail.com wrote: anyone give an algorithm of how to convert a binary search tree into a linkedlist -- *prasanth* -- You received this message because you are subscribed to the Google

Re: [algogeeks] tree to list

2011-09-21 Thread prasanth n
@sukran: must do it in place.. On Wed, Sep 21, 2011 at 7:01 PM, sukran dhawan sukrandha...@gmail.comwrote: do BFS search,at each level make a linked list On Wed, Sep 21, 2011 at 6:50 PM, prasanth n nprasnt...@gmail.com wrote: anyone give an algorithm of how to convert a binary search tree

Re: [algogeeks] Re: Microsoft Question

2011-09-21 Thread kartik sachan
i think i can solve this in O(n^2) here is code http://ideone.com/Gk69A # includestdio.h# includestring.hchar a[100][100];int findword(int *b,int n,int m){ int i,j,flag=0; char s[1]; for(i=0;in;i++) for(j=0;jm;j++) s[a[i][j]]++;

Re: [algogeeks] Re: c output

2011-09-21 Thread kartik sachan
@sukran if it is undefined in ansi c so it can return any value??? at complilaton.but all time it is giving me same value -- 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.

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
hmmm it is compiler dependent... try out with different compilers... but even though dey give same results,standard c left this eature as undefined for efficiency purposes On Wed, Sep 21, 2011 at 7:16 PM, kartik sachan kartik.sac...@gmail.comwrote: @sukran if it is undefined in ansi c so it

[algogeeks] question

2011-09-21 Thread prasanth n
You have given a positive number you have to find a number which is bigger than that by using same digits available in the number . Example :- You have given a number 7585 , your output should be 7855 . -- *prasanth* -- You received this message because you are subscribed to the Google Groups

[algogeeks] yahoo question

2011-09-21 Thread abhishek
You have given a number 123456789 and two opearators + and *. You can use this two operators as many times u want. But you cant change the sequence of the number given there. The evaluated value is 2097. e.g. 1+2+345*6+7+8+9=2097 You have to find all the such expressions that evaluates and

Re: [algogeeks] question

2011-09-21 Thread kartik sachan
http://ideone.com/xRnDo # includestdio.h# includestring.hvoid findbig(char *a){ int i,j; int flag=0; for(i=strlen(a)-1;i0;i--) if(a[i-1]a[i]) { char temp=a[i]; a[i]=a[i-1]; a[i-1]=temp; flag=1;

Re: [algogeeks] Re: c output

2011-09-21 Thread kartik sachan
thanks sukran... i have one more question evaluation of printf is also undefined in C?? -- 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,

[algogeeks] plz help

2011-09-21 Thread sush57
main() { int tmp; for(i=0;i9;i++) { tmp=fork(); if(tmp0) break; printf(Hello); } } what's the output and how does this work can u give few other questions using fork... -- You received

[algogeeks] Re: opengl

2011-09-21 Thread vikas
redbook, free available ebook On Sep 20, 9:28 pm, punnu punnu.gino...@gmail.com wrote: please somebody suggest some good tutorial in animation in opengl using c++.. thanks in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] Function pointer

2011-09-21 Thread teja bala
Where can we use function pointers in C, what are the uses of function pointers? come up with new one not like callback , qsort etc... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] yahoo question

2011-09-21 Thread Simran Singh
Hey.. Which college you from..?? And please do tell more about their process.. On Wed, Sep 21, 2011 at 7:31 PM, abhishek abhishek.ma...@gmail.com wrote: You have given a number 123456789 and two opearators + and *. You can use this two operators as many times u want. But you cant change the

[algogeeks] Re: question

2011-09-21 Thread Dave
@Prasanth: Since there is no requirement to find the next larger number, you can go for the largest. Extract the digits into an array using modulus and division by 10. Then sort the digits into descending order. Finally, construct the answer by repeated multiplication by 10 and addition. If you

Re: [algogeeks] Re: adobe written round que

2011-09-21 Thread annarao kataru
can u explain the logic behind this thanks in advance -- 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

Re: [algogeeks] yahoo question

2011-09-21 Thread shady
@simran you interested in solving problem or knowing the company recruitment process :P @abhishek looks like a dynamic programming problem one simple brute force solution will be to go recursively down and evaluate all expressions one by one On Wed, Sep 21, 2011 at 8:22 PM, Simran Singh

[algogeeks] Qualcomm

2011-09-21 Thread Prags
Hi frnds, can anybody tell me about the placement procedure of Qualcomm ?? How many rounds do they have ? And how is its profile ? ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: yahoo question

2011-09-21 Thread abhishek
DCE i am also want to know recruitment process as it is coming on 23rd. On Sep 21, 7:52 pm, Simran Singh sammy.4...@gmail.com wrote: Hey.. Which college you from..?? And please do tell more about their process.. On Wed, Sep 21, 2011 at 7:31 PM, abhishek abhishek.ma...@gmail.com wrote:

[algogeeks] INFORMATICAA...........PLZ HELP !!

2011-09-21 Thread siva viknesh
hi Informatica is coming to our campus in just five days.heard it came to many north collegesthose who attended plz tell me d pattern and ques u got in all rounds... thanks in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Flipkart

2011-09-21 Thread Prags
Hi frnds, can anybody tell me about the placement procedure of FLIPKART ?? How many rounds do they have ? ? please post some questions if u have attended. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: c output

2011-09-21 Thread sukran dhawan
its right to left On Wed, Sep 21, 2011 at 7:41 PM, kartik sachan kartik.sac...@gmail.comwrote: thanks sukran... i have one more question evaluation of printf is also undefined in C?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: yahoo question

2011-09-21 Thread Simran Singh
http://stackoverflow.com/questions/4573744/modify-a-given-number-to-find-the-required-sum/4573881#4573881 for solution.. And please do share all the info you gather about the process.. On Wed, Sep 21, 2011 at 9:31 PM, abhishek abhishek.ma...@gmail.com wrote: DCE i am also want to know

Re: [algogeeks] INFORMATICAA...........PLZ HELP !!

2011-09-21 Thread vijay singh
It will be asking questions from C, C++ and DS (mainly). Here is the feedback, you can download it... -- 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

[algogeeks] Flip kart

2011-09-21 Thread sagar pareek
Hello ... Do anyone know the process and questions of flip kart ?? -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Flip kart

2011-09-21 Thread arpit rajpurohit
How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.comwrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You

[algogeeks] C OUTPUT

2011-09-21 Thread kartik sachan
int main(){ struct { int a:1; int b:3; }obj; obj.b=12; obj.a=7; printf http://www.opengroup.org/onlinepubs/009695399/functions/printf.html(%d %d,obj.b,obj.a);return 0;} can anybody explain the output plzz also show

[algogeeks] Re: question

2011-09-21 Thread Ankuj Gupta
If it is the first largest ? On Sep 21, 8:02 pm, Dave dave_and_da...@juno.com wrote: @Prasanth: Since there is no requirement to find the next larger number, you can go for the largest. Extract the digits into an array using modulus and division by 10. Then sort the digits into descending

Re: [algogeeks] Re: question

2011-09-21 Thread kartik sachan
obivously it will be first largest -- 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.

Re: [algogeeks] C OUTPUT

2011-09-21 Thread ravi maggon
output is -4 -1 int a:1 signifies that only 1 bit will be stored for a and since we have only 1 bit so it will serve as sign bit and we get obj.a as -1 similarly for int b:3, 3 bits will be used to store b. 12 is 1100. we save only 3 bits i.e. 100 where msb signifies the sign i.e. no. is negative.

Re: [algogeeks] INFORMATICAA...........PLZ HELP !!

2011-09-21 Thread ravi maggon
most of questions are already discussed. Search previous threads or my posts. On Wed, Sep 21, 2011 at 10:03 PM, vijay singh vijaysinghb...@gmail.comwrote: It will be asking questions from C, C++ and DS (mainly). Here is the feedback, you can download it... -- You received this message

Re: [algogeeks] C OUTPUT

2011-09-21 Thread kartik sachan
@ravi i think ur concepts is correct the no is stored in 2's formif negative 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 unsubscribe from this group,

Re: [algogeeks] Function pointer

2011-09-21 Thread shivank goyal
one of the use of function pointer is to implement run time polymorphism in C. -- 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] Re: INFORMATICAA...........PLZ HELP !!

2011-09-21 Thread siva viknesh
thanks a lot guys.. On Sep 21, 10:17 pm, ravi maggon maggonr...@gmail.com wrote: most of questions are already discussed. Search previous threads or my posts. On Wed, Sep 21, 2011 at 10:03 PM, vijay singh vijaysinghb...@gmail.comwrote: It will be asking questions from C, C++ and DS

Re: [algogeeks] Qualcomm

2011-09-21 Thread Prags
@Vijay- thanx alot. Btw hv Qualcomm visited ur college ? On Wed, Sep 21, 2011 at 10:13 PM, vijay singh vijaysinghb...@gmail.comwrote: Here are the feedback for Qualcomm.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

[algogeeks] Time complexity

2011-09-21 Thread sivaviknesh s
for(i=0;in;i++) for(j=0;ji*i;j++) for(k=0;kj;k++) sum++; Is itn^5 log n . n * (n^2 log n) * (n^2 log n) ??? correct me if i m wrong? also anybody can tell some easy approach to tackle these ques ?? I worked out for some values of n and arrived at the ans.

Re: [algogeeks] Flip kart

2011-09-21 Thread sagar pareek
it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.comwrote: Hello ... Do anyone know the process and

Re: [algogeeks] plz help

2011-09-21 Thread Saravana kumar
Hello will be printed 45 times... On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote: main() { int tmp; for(i=0;i9;i++) { tmp=fork(); if(tmp0) break; printf(Hello); } }

Re: [algogeeks] plz help

2011-09-21 Thread Anil Arya
http://ideone.com/nkTVN On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar saravana@gmail.comwrote: Hello will be printed 45 times... On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote: main() { int tmp; for(i=0;i9;i++) {

Re: [algogeeks] Flip kart

2011-09-21 Thread arpit rajpurohit
which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21,

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
Output Hello printed 10 times. Since form command spawns the process, so for every call their are two process created and since if process gets successfully created fork returns some positive no. which is the process id, so it will break the loop and finally only the 10 child processes will be

Re: [algogeeks] Flip kart

2011-09-21 Thread sagar pareek
nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit

[algogeeks] sql triggers

2011-09-21 Thread himanshu kansal
i want to create a trigger in sql server 2008 the trigger should raise an error if the user want to enter a row which has already been entered twice... means the row cannot repeat itself more than two times on third tym it shld raise an error PS: the trigger should be ms sql server

Re: [algogeeks] Re: question

2011-09-21 Thread Anil Arya
@kartik Is it right On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan kartik.sac...@gmail.comwrote: obivously it will be first largest -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: question

2011-09-21 Thread Anil Arya
http://ideone.com/pmil8 On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote: @kartik Is it right On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan kartik.sac...@gmail.comwrote: obivously it will be first largest -- You received this message because you are

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
@ravi can u plz explain how 10 processes are created..? shouldn't it be 9..?? On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon maggonr...@gmail.com wrote: Output Hello printed 10 times. Since form command spawns the process, so for every call their are two process created and since if process

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed. On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi can u plz explain how 10 processes are created..? shouldn't it be 9..?? On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
@ravi: thanks..!! On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon maggonr...@gmail.com wrote: ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed. On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi can u plz explain how 10 processes are

Re: [algogeeks] plz help

2011-09-21 Thread teja bala
@ ravi but compile it on http://ideone.com/nkTVN it showing 45 hello plz do look at it... On Thu, Sep 22, 2011 at 12:59 AM, Rashmi Jain rashmi.jain...@gmail.comwrote: @ravi: thanks..!! On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon maggonr...@gmail.comwrote: ohh sorry, I thought it was

[algogeeks] Re: tree to list

2011-09-21 Thread Gene
#include stdio.h typedef struct node_s { int data; struct node_s *left, *right; } NODE; // Convert BST to a sorted list connected by -right pointers. NODE *to_list(NODE *tree, NODE *tail) { if (tree == NULL) return tail; tree-right = to_list(tree-right, tail); return to_list(tree-left,

Re: [algogeeks] plz help

2011-09-21 Thread ravi maggon
This is the output I am getting - result: Success time: 0smemory: 1720 kB returned value: 0 input: no output: HelloHelloHelloHelloHelloHelloHelloHelloHelloHello On Thu, Sep 22, 2011 at 1:40 AM, teja bala pawanjalsa.t...@gmail.comwrote: @ ravi but compile it on

Re: [algogeeks] plz help

2011-09-21 Thread Rashmi Jain
but in this output 10 times hello is printed..how..?? On Thu, Sep 22, 2011 at 1:52 AM, ravi maggon maggonr...@gmail.com wrote: This is the output I am getting - result: Success time: 0smemory: 1720 kB returned value: 0 input: no output:

Re: [algogeeks] Re: question

2011-09-21 Thread kartik sachan
@arya ur code for 7695...giving ans 9765 but ans should be 7965 -- 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] easy c output....

2011-09-21 Thread Anil Arya
#includestdio.h #define power(a) #a int main(){printf(%d\n,*power(432));return 0;} why it is giving 52 as output? -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google

[algogeeks] can any body explain the output and the general method

2011-09-21 Thread him
http://www.ideone.com/8iPGF int main() { int i=5; printf(%d, ++i + ++i + ++i); return 0; } output : 22 why 22? can anybody spell out the reasons and the general way in which the expression in evaluated in such cases? -- You received this message because you are subscribed to the Google

Re: [algogeeks] easy c output....

2011-09-21 Thread Balaji
Hi Anil, #a is a preprocessor operator to convert the argument specified as string or enclosing in double quotes. so, after macro expansion, the printf statement would become printf(%d\n,*432); = printf(%d\n,432[0]);= printf(%d\n,*4); which prints the ASCII equivalent 52. Similarly, using

[algogeeks] Re: subarray wid sum=k

2011-09-21 Thread Aviral Gupta
Make an associative sum array ... then find two indexes in the new array such that b[j] - b[i] =k, which can be done by a hash table. The found indexes form ur answer , i+1 j. For e.g A = {1,2,3,4,5,6,7,8,9} B = {1,3,6,10,15,21,28,36,45} and k = 15 now B[5] - B[2] = 15 so ans is 3 5 i.e 4+5+6

[algogeeks] Re: Time complexity

2011-09-21 Thread siva viknesh
somebody plz reply... On Sep 21, 10:53 pm, sivaviknesh s sivavikne...@gmail.com wrote: for(i=0;in;i++)     for(j=0;ji*i;j++)         for(k=0;kj;k++)             sum++; Is it    n^5 log n . n * (n^2 log n) * (n^2 log n) ??? correct me if i m wrong?  also anybody can tell some easy

[algogeeks] Re: can any body explain the output and the general method

2011-09-21 Thread Dave
@Himanshuarora: This code violates the sequence point rule (google it), which essentially says that a variable can change values at most one time between sequence points. Therefore, the output is compiler dependent. Dave On Sep 21, 6:40 pm, him himanshuarora.1...@gmail.com wrote:

[algogeeks] Re: Time complexity

2011-09-21 Thread Dave
@Siva: Work from the inside out, using the identities sum from i = 1 to n (i) = n*(n+1)/2 sum from i = 1 to n (i^2) = n*(n+1)*(2*n+1)/6 sum from i = 1 to n (i^3) = n^2*(n+1)^2/4 sum from i = 1 to n (i^4) = n^5/5 + n^4/2 + n^3/3 - n/30 Dave On Sep 21, 10:03 pm, siva viknesh

[algogeeks] MICROSOFT IDC

2011-09-21 Thread saurabh
I sincerely thank this group as i got selected in MSIDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is

[algogeeks] Re: plz help

2011-09-21 Thread siva viknesh
somebody try to execute in linux and try to find the output...expected output is 9but when first in ideone without \n in printf it showed 7 .. then with \n it showed 10... again with \n it showed 10 !!! .. whether its prob with compiler or fork's execution is differing i'm confused :( On Sep

[algogeeks] Re: plz help

2011-09-21 Thread siva viknesh
http://ideone.com/l5ek4 .. in this it had shown 6 http://ideone.com/Lj56O .. here 10 On Sep 22, 8:27 am, siva viknesh sivavikne...@gmail.com wrote: somebody try to execute in linux and try to find the output...expected output is 9but when first in ideone without \n in printf it

[algogeeks] THANX ALGOGEEKS !!!!!!

2011-09-21 Thread saurabh
I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews

[algogeeks] Re: plz help

2011-09-21 Thread siva viknesh
if anybody knows other good online compilers try to post ... codepad doesn't support fork On Sep 22, 8:29 am, siva viknesh sivavikne...@gmail.com wrote: http://ideone.com/l5ek4  .. in this it had shown 6 http://ideone.com/Lj56O .. here 10 On Sep 22, 8:27 am, siva viknesh

[algogeeks] Re: plz help

2011-09-21 Thread siva viknesh
expected op is 9 .. since on each iteration parent process gets cancelled out (its pid 0 ) and child process alone prints hello .. no chance of getting 10 or any other output .. correct me if m wrong ! On Sep 22, 8:31 am, siva viknesh sivavikne...@gmail.com wrote: if anybody knows other good

[algogeeks] Re: Time complexity

2011-09-21 Thread siva viknesh
@Dave ... thanks dude.So it should be O(n^5) .. am i right ?? On Sep 22, 8:19 am, Dave dave_and_da...@juno.com wrote: @Siva: Work from the inside out, using the identities sum from i = 1 to n (i) = n*(n+1)/2 sum from i = 1 to n (i^2) = n*(n+1)*(2*n+1)/6 sum from i = 1 to n (i^3) =

[algogeeks] Re: Time complexity

2011-09-21 Thread Ankuj Gupta
yes it is n^5 On Sep 22, 8:53 am, siva viknesh sivavikne...@gmail.com wrote: @Dave ... thanks dude.So it should be O(n^5) .. am i right ?? On Sep 22, 8:19 am, Dave dave_and_da...@juno.com wrote: @Siva: Work from the inside out, using the identities sum from i = 1 to n (i) =

[algogeeks] Re: THANX ALGOGEEKS !!!!!!

2011-09-21 Thread techankur
Congrats Saurabh :) Ankur Mittal -- 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] Function pointer

2011-09-21 Thread anshu mishra
as function object also -- 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,

[algogeeks] An Article worth sharing!!

2011-09-21 Thread karansac...@gmail.com
Hi Folks, I found this article that can help you to hone up your programming skills :- http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer/ ~Cheers, Karan -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: plz help

2011-09-21 Thread ravi maggon
I tried to run code on Mac Os and getting output as 9 times Hello. On Thu, Sep 22, 2011 at 9:19 AM, siva viknesh sivavikne...@gmail.comwrote: expected op is 9 .. since on each iteration parent process gets cancelled out (its pid 0 ) and child process alone prints hello .. no chance of

Re: [algogeeks] MICROSOFT IDC

2011-09-21 Thread Sanjay Rajpal
Hey saurabh, many many congratulations to u. Would u plz tell about the level of difficulty of questions asked in Interview round and also the kind of people they want ? Sanju :) On Wed, Sep 21, 2011 at 8:26 PM, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got

Re: [algogeeks] MICROSOFT IDC

2011-09-21 Thread vishwa
congrts!! On Thu, Sep 22, 2011 at 10:09 AM, Sanjay Rajpal srn...@gmail.com wrote: Hey saurabh, many many congratulations to u. Would u plz tell about the level of difficulty of questions asked in Interview round and also the kind of people they want ? Sanju :) On Wed, Sep 21, 2011

Re: [algogeeks] Re: THANX ALGOGEEKS !!!!!!

2011-09-21 Thread shady
awesome, congrats... and keep contributing to the group :) On Thu, Sep 22, 2011 at 9:41 AM, techankur ankurmitta...@gmail.com wrote: Congrats Saurabh :) Ankur Mittal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] MS-IT

2011-09-21 Thread ankit arun
hi!! MS-IT is visiting our college. could anyone plz help me in knowing what kind of questions(interview) they asked/asking. Thanks in advance. Ankit Arun NIT Durgapur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion

Re: [algogeeks] Re: THANX ALGOGEEKS !!!!!!

2011-09-21 Thread Anil Arya
congrates dude.. On Thu, Sep 22, 2011 at 10:25 AM, shady sinv...@gmail.com wrote: awesome, congrats... and keep contributing to the group :) On Thu, Sep 22, 2011 at 9:41 AM, techankur ankurmitta...@gmail.comwrote: Congrats Saurabh :) Ankur Mittal -- You received this message

Re: [algogeeks] Re: THANX ALGOGEEKS !!!!!!

2011-09-21 Thread Siddhartha Banerjee
share the questions for the group!!! and congrats and thanks in advance...: -- 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