Re: [algogeeks] Question asked in Amazon Online Test
i think this algo will do... reverse the given prefix expression while(!nd of input) { if it is operand push in a stack if its an operator { op1=pop(stack); op2=pop(stack); push (op1 op2 operator) on to stack; } } On Sat, Jun 30, 2012 at 1:56 AM, Bhaskar Kushwaha bhaskar.kushwaha2...@gmail.com wrote: example -+53+2/36 step 1: 63/2+35+- step 2: 36/2+53+- On Sat, Jun 30, 2012 at 1:55 AM, Bhaskar Kushwaha bhaskar.kushwaha2...@gmail.com wrote: reverse the prefix notation and then reverse each continuous occurence of operands On Sat, Jun 30, 2012 at 12:50 AM, Abhishek Sharma abhi120...@gmail.comwrote: convert prefix to infix,then convert infix to postfix.Now, to convert prefix to infix, push numbers in one stack and operators in other.Then use thishttp://www.velocityreviews.com/forums/t445633-prefix-to-infix-conversion.html algo to perform this.Then do the same for infix to postfix.It works with simple operators,but difficult to implement with parenthesis. On Sat, Jun 30, 2012 at 12:21 AM, rahul ranjan rahul.ranjan...@gmail.com wrote: oh bhai mere. kewal preorder use karke kaise tree bana dega??? On Fri, Jun 29, 2012 at 11:23 PM, amrit harry dabbcomput...@gmail.comwrote: @bhaskar ur algo fails on this case (5+3)-(2+(3/6)) -+53+2/36 63/2+35-+ showing that 6/3 but actually it is 3/6 so i think it could be done by folowing algo make a binary tree of given expression in O(n) then do postorder traversal take O(n) so problem can be solved in O(n). and take O(2*n+1) space On Fri, Jun 29, 2012 at 9:13 PM, Bhaskar Kushwaha bhaskar.kushwaha2...@gmail.com wrote: I think just reversing the prefix notation converts it to postfix notation On Fri, Jun 29, 2012 at 7:46 PM, Gobind Kumar Hembram gobind@gmail.com wrote: Given an integer expression in a prefix format (i.e. the operator precedes the number it is operating on) , print the expression in the post fix format . Example: If the integer expression is in the prefix format is *+56-78, the postfix format expression is 56+78-*. Both of these correspond to the expression (5+6)*(7-8). -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, Bhaskar Kushwaha Student Final year CSE M.N.N.I.T. 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, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards Amritpal singh -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Abhishek Sharma Under-Graduate Student, PEC University of Technology -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, Bhaskar Kushwaha Student Final year CSE M.N.N.I.T. Allahabad -- regards, Bhaskar Kushwaha Student Final year CSE M.N.N.I.T. 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, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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] Adobe interview question
So, i think there is no way to implement abstract class without using pure virtual functions since 1. if we make the constructor private then derived classes cannot be instantiatedthey too become abstract class. 2. if we make constructor protected, then derived class will be able to create (instantiate ) objects of base classwhich is ofcourse we dont want any other way would be highly appreciated On Wed, Jun 27, 2012 at 11:16 PM, rahul sharma rahul23111...@gmail.comwrote: @himanshu...i didnt read full question.got it now... On Mon, Jun 25, 2012 at 9:12 AM, himanshu kansal himanshukansal...@gmail.com wrote: @rahul: the ques itself says that we have to implement abstract class*without * using pure virtual function... On Sun, Jun 24, 2012 at 12:00 AM, rahul sharma rahul23111...@gmail.comwrote: yeah use pure virtual fxn.. On Fri, Jun 22, 2012 at 3:41 PM, himanshu kansal himanshukansal...@gmail.com wrote: i told the interviewer...bt he said thn the constt would not be accessible to derived class alsohe told me dt u shld make the constt. protecteddats why i ws confused... On Fri, Jun 22, 2012 at 2:38 PM, raghavan M peacelover1987...@yahoo.co.in wrote: Make all constructors private. -- *From:* himanshu kansal himanshukansal...@gmail.com *To:* Algorithm Geeks algogeeks@googlegroups.com *Sent:* Friday, 22 June 2012 1:44 PM *Subject:* [algogeeks] Adobe interview question How will u implement an abstract class in c++ w/o using pure virtual function??? will making all the constructors and assignment operators protected suffice??? i doubt since the derived classes will be able to create objects of that classand according to definition of abstract class, no object of it should be created... any other way?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Adobe interview question
@rahul: the ques itself says that we have to implement abstract class*without * using pure virtual function... On Sun, Jun 24, 2012 at 12:00 AM, rahul sharma rahul23111...@gmail.comwrote: yeah use pure virtual fxn.. On Fri, Jun 22, 2012 at 3:41 PM, himanshu kansal himanshukansal...@gmail.com wrote: i told the interviewer...bt he said thn the constt would not be accessible to derived class alsohe told me dt u shld make the constt. protecteddats why i ws confused... On Fri, Jun 22, 2012 at 2:38 PM, raghavan M peacelover1987...@yahoo.co.in wrote: Make all constructors private. -- *From:* himanshu kansal himanshukansal...@gmail.com *To:* Algorithm Geeks algogeeks@googlegroups.com *Sent:* Friday, 22 June 2012 1:44 PM *Subject:* [algogeeks] Adobe interview question How will u implement an abstract class in c++ w/o using pure virtual function??? will making all the constructors and assignment operators protected suffice??? i doubt since the derived classes will be able to create objects of that classand according to definition of abstract class, no object of it should be created... any other way?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Adobe interview question
How will u implement an abstract class in c++ w/o using pure virtual function??? will making all the constructors and assignment operators protected suffice??? i doubt since the derived classes will be able to create objects of that classand according to definition of abstract class, no object of it should be created... any other way?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Adobe interview question
i told the interviewer...bt he said thn the constt would not be accessible to derived class alsohe told me dt u shld make the constt. protecteddats why i ws confused... On Fri, Jun 22, 2012 at 2:38 PM, raghavan M peacelover1987...@yahoo.co.inwrote: Make all constructors private. -- *From:* himanshu kansal himanshukansal...@gmail.com *To:* Algorithm Geeks algogeeks@googlegroups.com *Sent:* Friday, 22 June 2012 1:44 PM *Subject:* [algogeeks] Adobe interview question How will u implement an abstract class in c++ w/o using pure virtual function??? will making all the constructors and assignment operators protected suffice??? i doubt since the derived classes will be able to create objects of that classand according to definition of abstract class, no object of it should be created... any other way?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] first Repeating character in a string
how can we find 1st repeating character in string??? e.g. if the string is abba it should return 'b' and not 'a'. note: hashing will give the answer as 'a' -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] first Repeating character in a string
@all: my bad...i ws confused while posting the ques. hashing can gv either a or bonly thing tht matters is hw u implement hashing and counting thanx i hv got the soln On Fri, Jun 8, 2012 at 4:33 PM, Saurabh Yadav saurabh...@gmail.com wrote: order of hashing and counting is important eg. abba if we do hashing by characters 'a' is stored before 'b' and count of both is 2 at the end and when we process this we give result 'a' (because 'a' comes before 'b' )which is wrong because 'b' is the first repeated character. Thanks Regards Saurabh -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] problem of fork()
i know that the program sholud have printed hello word 8 timesbt whn i run it, i get diffrnt reslts everytime and on diffrnt compilers... please tell the reason On Thu, May 24, 2012 at 11:11 AM, rajesh singarapu rajesh0...@gmail.comwrote: main process have completed till the time all processes processes prints Hello World, to prevent it, use wait/wait4 family of fucntions. ~r On Thu, May 24, 2012 at 8:26 AM, Rajesh Kumar testalgori...@gmail.com wrote: #includestdio.h main() { fork(); fork(); fork(); printf(Hello Word\n); } output --- rajeshkumar@rajeshkumar-laptop:~$ ./a.out Hello Word Hello Word Hello Word rajeshkumar@rajeshkumarr-laptop:~$ Hello Word Hello Word Hello Word Hello Word Hello Word Why it is not printed continously? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] fork command confusion
#includestdio.h int main() { printf(hello); fork(); printf(world); } what will be the o/p on my system...its showing hello world hello world... but i think it could be hello world two times in any order. please tell me what is the exact o/p... i have a little confusion also that whether child process starts executing from start of the main() or whether it starts from the line following the fork() command. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Detect a loop with just head ptr given
if u cant create new ptrsthen i think horse and tortoise strategy will fail. then you can only modify the linked lists to detect the loop. one other strategy could be to reverse the linked list.after reversing the linked list, if you arrive at the head itself then the list contains the loop i know reversing of list will require additional three ptrsbt this is also one of the way On Thu, Dec 8, 2011 at 9:43 PM, hary rathor harry.rat...@gmail.com wrote: take two pointer run first with one speed and another with two until they meet, now take a first pointer and assign with head of list . now move again both same speed (only one forward at a time ) now as they meet at point that will be your starting pointer of loop. On 12/8/11, Deepak Nettem deepaknet...@gmail.com wrote: If you allow storing an extra bit with every node (to mark whether a node has been visited), you can do it with just one pointer. But that's less space efficient (O(n)) than using two pointers of varying speeds. On Thu, Dec 8, 2011 at 9:04 AM, Ankur Garg ankurga...@gmail.com wrote: U cant create any new ptrs .Just use this ptr :) On Thu, Dec 8, 2011 at 6:30 PM, Prem Krishna Chettri hprem...@gmail.comwrote: Ofcourse we can.. U knw the head address now U start visit the list what is the big deal?? Jst u gotto create two pointer say fast and slow with two diff speed of action.. On Thu, Dec 8, 2011 at 6:27 PM, Ankur Garg ankurga...@gmail.com wrote: Can we detect if a loop is present in Linked List if only head ptr is given -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Harish Pranami Master Of Computer Application , Deptt of computer Science, north campus , university of delhi, New Delhi pin no - 110007 -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Detect a loop with just head ptr given
@sayan: take a singley linked list (not circular) with a loop in ittry to reverse it.you will get why i gave this algo...it can be reversedand it always ends up landing at original head of list if it contains a loop give it a try... On Thu, Dec 8, 2011 at 11:30 PM, sayan nayak sayanna...@gmail.com wrote: @Himanshu: How can u reverse a linked list which has only the beginning(head) but no tail... And even if I consider that by some means u have reversed it..then also there is no guarantee that u reach the head.. Because the LinkedList is not necessarily circular..a circular Linkedlist and a linkedlist with loop are not same...Cicular is one specific case of Loop. Pls correct me If I have misunderstood your explanation. Regards, Sayan On Thu, Dec 8, 2011 at 10:27 PM, himanshu kansal himanshukansal...@gmail.com wrote: if u cant create new ptrsthen i think horse and tortoise strategy will fail. then you can only modify the linked lists to detect the loop. one other strategy could be to reverse the linked list.after reversing the linked list, if you arrive at the head itself then the list contains the loop i know reversing of list will require additional three ptrsbt this is also one of the way On Thu, Dec 8, 2011 at 9:43 PM, hary rathor harry.rat...@gmail.comwrote: take two pointer run first with one speed and another with two until they meet, now take a first pointer and assign with head of list . now move again both same speed (only one forward at a time ) now as they meet at point that will be your starting pointer of loop. On 12/8/11, Deepak Nettem deepaknet...@gmail.com wrote: If you allow storing an extra bit with every node (to mark whether a node has been visited), you can do it with just one pointer. But that's less space efficient (O(n)) than using two pointers of varying speeds. On Thu, Dec 8, 2011 at 9:04 AM, Ankur Garg ankurga...@gmail.com wrote: U cant create any new ptrs .Just use this ptr :) On Thu, Dec 8, 2011 at 6:30 PM, Prem Krishna Chettri hprem...@gmail.comwrote: Ofcourse we can.. U knw the head address now U start visit the list what is the big deal?? Jst u gotto create two pointer say fast and slow with two diff speed of action.. On Thu, Dec 8, 2011 at 6:27 PM, Ankur Garg ankurga...@gmail.com wrote: Can we detect if a loop is present in Linked List if only head ptr is given -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Harish Pranami Master Of Computer Application , Deptt of computer Science, north campus , university of delhi, New Delhi pin no - 110007 -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email
Re: [algogeeks] virtual destructor problem
i think it wd be only derivedclass2 Des called. since it is not the virtual destructor...if you want to make it a virtual destrcutor add keyword virtual to the destructor of base classs On Wed, Dec 7, 2011 at 2:51 PM, deepak kumar deepak.kuma...@gmail.comwrote: Hi All, I am sharing with you all a problem . The problem is as follow class baseClass { public : ~baseClass() { cout baseClass Des called endl; } }; /*Derived class*/ class derivedClass1 : public baseClass { public: *virtual *~derivedClass1() {cout derivedClass1 Des called endl;} }; /*Derived class*/ class derivedClass2 : public baseClass { public: ~derivedClass2() {cout derivedClass2 Des called endl;} }; int main() { baseClass *bPtr = new derivedClass2(); delete bPtr; } Can anyone tell me what will be the output and why ? Note: the virtual destructor in derivedClass1. -- Thanks and Regards Deepak Kumar -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] virtual destructor problem
dude it does not crashes outon which compiler are you running it On Wed, Dec 7, 2011 at 5:30 PM, deepak kumar deepak.kuma...@gmail.comwrote: Dudes, The 1st part is clear and easy also, since it will do the static linking and will call the base class destructor . But for my surprize, it calls the destructor(base class) and soon after that it crashes out. I wanted to know the reason as why it *crashes out*. On Wed, Dec 7, 2011 at 5:16 PM, himanshu kansal himanshukansal...@gmail.com wrote: ya...sorry only baseclass des would be called On Wed, Dec 7, 2011 at 4:00 PM, Amit Basak abas...@gmail.com wrote: For the main question, the base class destructor will be called and the output of the program will be: baseClass Des called. This is because, when delete bPtr; is called, the base class destructor will be called as bPtr is of type baseClass. And since baseClass destructor is not decalred as virtual, so the type of the object that bPtr points to does not come into picture. In other words, the base part of memory held by derivedClass2 object will only be destructed here. @Prem Krishna Chettri's question: In this case also only the baseClass's destructor will be called and hence we will have two lines output as baseClass Des called baseClass Des called This is why it is always advisable to make the destructor as virtual. Amit On Wed, Dec 7, 2011 at 3:27 PM, Prem Krishna Chettri hprem...@gmail.com wrote: The Output would be only the base class object destructor would be called so output :- derivedClass2 Des called Now why .. It is no more than just a base parent concept here, so base pointer capable if holding its derived object address get's derived object as new derivedClass2() creates only derived object. However, by deleting that pointer would results in destructing of this object which is the object of the derived class type derivedClass2. Well, I Guess what would be more interesting if you have a main something like this :- int main() { baseClass *aPtr = new derivedClass1(); baseClass *bPtr = new derivedClass2(); delete aPtr; delete bPtr; } On Wed, Dec 7, 2011 at 2:51 PM, deepak kumar deepak.kuma...@gmail.comwrote: Hi All, I am sharing with you all a problem . The problem is as follow class baseClass { public : ~baseClass() { cout baseClass Des called endl; } }; /*Derived class*/ class derivedClass1 : public baseClass { public: *virtual *~derivedClass1() {cout derivedClass1 Des called endl;} }; /*Derived class*/ class derivedClass2 : public baseClass { public: ~derivedClass2() {cout derivedClass2 Des called endl;} }; int main() { baseClass *bPtr = new derivedClass2(); delete bPtr; } Can anyone tell me what will be the output and why ? Note: the virtual destructor in derivedClass1. -- Thanks and Regards Deepak Kumar -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks and Regards Deepak Kumar -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group
Re: [algogeeks] virtual destructor problem
yeahi am using visual c++ 32 bit compiler...and it didnt crashes.just give the desired output... On Wed, Dec 7, 2011 at 9:20 PM, deepak kumar deepak.kuma...@gmail.comwrote: Did you try it out on ur machine? M using g++ compiler. On Wed, Dec 7, 2011 at 5:36 PM, himanshu kansal himanshukansal...@gmail.com wrote: dude it does not crashes outon which compiler are you running it On Wed, Dec 7, 2011 at 5:30 PM, deepak kumar deepak.kuma...@gmail.comwrote: Dudes, The 1st part is clear and easy also, since it will do the static linking and will call the base class destructor . But for my surprize, it calls the destructor(base class) and soon after that it crashes out. I wanted to know the reason as why it *crashes out*. On Wed, Dec 7, 2011 at 5:16 PM, himanshu kansal himanshukansal...@gmail.com wrote: ya...sorry only baseclass des would be called On Wed, Dec 7, 2011 at 4:00 PM, Amit Basak abas...@gmail.com wrote: For the main question, the base class destructor will be called and the output of the program will be: baseClass Des called. This is because, when delete bPtr; is called, the base class destructor will be called as bPtr is of type baseClass. And since baseClass destructor is not decalred as virtual, so the type of the object that bPtr points to does not come into picture. In other words, the base part of memory held by derivedClass2 object will only be destructed here. @Prem Krishna Chettri's question: In this case also only the baseClass's destructor will be called and hence we will have two lines output as baseClass Des called baseClass Des called This is why it is always advisable to make the destructor as virtual. Amit On Wed, Dec 7, 2011 at 3:27 PM, Prem Krishna Chettri hprem...@gmail.com wrote: The Output would be only the base class object destructor would be called so output :- derivedClass2 Des called Now why .. It is no more than just a base parent concept here, so base pointer capable if holding its derived object address get's derived object as new derivedClass2() creates only derived object. However, by deleting that pointer would results in destructing of this object which is the object of the derived class type derivedClass2. Well, I Guess what would be more interesting if you have a main something like this :- int main() { baseClass *aPtr = new derivedClass1(); baseClass *bPtr = new derivedClass2(); delete aPtr; delete bPtr; } On Wed, Dec 7, 2011 at 2:51 PM, deepak kumar deepak.kuma...@gmail.com wrote: Hi All, I am sharing with you all a problem . The problem is as follow class baseClass { public : ~baseClass() { cout baseClass Des called endl; } }; /*Derived class*/ class derivedClass1 : public baseClass { public: *virtual *~derivedClass1() {cout derivedClass1 Des called endl;} }; /*Derived class*/ class derivedClass2 : public baseClass { public: ~derivedClass2() {cout derivedClass2 Des called endl;} }; int main() { baseClass *bPtr = new derivedClass2(); delete bPtr; } Can anyone tell me what will be the output and why ? Note: the virtual destructor in derivedClass1. -- Thanks and Regards Deepak Kumar -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks and Regards Deepak Kumar -- 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
Re: [algogeeks] Re: array searching
@SAM: in your first step, where you are xoring the unique elements, you must be using some DS such as hashtable or something. so space complexity will be O(n). can someone reduces this O(n) space complexity.because it wont be a good approach if there are many elements in the array On Fri, Nov 18, 2011 at 9:26 AM, SAMM somnath.nit...@gmail.com wrote: On 11/18/11, SAMM somnath.nit...@gmail.com wrote: For example the array has .. 1 4 2 6 7 4 8 3.. xor the elements in the array will give (1^2^6^7^8^3). now xor the unique elements using hash table ,It gives (1^4^2^6^7^8^3). Now xor these two value which gives 4. On 11/18/11, Dave dave_and_da...@juno.com wrote: @SAMM: It sounds like a circular argument. How do you XOR all of the unique elements without first finding the repeated ones? Dave On Nov 17, 11:24 am, SAMM somnath.nit...@gmail.com wrote: Yes we can do so in O(n) . First find the XOR of all unique elements using hash table or some other DS. Secondly XOR all the elements of the array .which will hav the xor of elements other thn the element repeated twice. Now XOR the above two value which will give the answer.. On 11/17/11, himanshu kansal himanshukansal...@gmail.com wrote: consider an array having n elements.out of which one number is repeated twiceother number are repeated odd number of times(for simplicity, assume other numbers are occurring just once) can you find the number that is repeated twice in O(n) time??? PS: numbers are not from a particular range. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Somnath Singh -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Somnath Singh -- Somnath Singh -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: heap memory
@Gene: since the article itself says that if the memory is allocated through malloc, it will make some (less) sbrk calls to the system to increase the allocated memory to the program. then how can a wrapper function will do the malloc internally will call the sbrk function and will increase the allocated memorythe wrapper func would have know way of finding that the memory has been increased secondly, it will ignore the amount of chunk that would have been used for bookkeeping. it cannot be done using wrapper function On Sun, Nov 6, 2011 at 3:18 AM, Gene gene.ress...@gmail.com wrote: In C you can get close by wrapping malloc() and free() and maintaining your own total. This will not capture the header within each malloc()'ed block. You can also use a tool like valgrind . The behavior of sbrk() is totally OS dependent, and sbrk() doesn't exist on e.g. Windows. This method won't work reliably on Linux either. Here is a pretty good article for details on Linux memory allocation: http://www.linuxjournal.com/article/6390?page=0,0 On Nov 5, 6:28 pm, himanshu kansal himanshukansal...@gmail.com wrote: can we know the size of heap memory allocated to our program i think sbrk(0) will return the address of end of heap. but how to find the start of heap so that we can calculate the size of total heap memory allocated to our program is there any way possible -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] heap memory
can we know the size of heap memory allocated to our program i think sbrk(0) will return the address of end of heap. but how to find the start of heap so that we can calculate the size of total heap memory allocated to our program is there any way possible -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Virtual table
when the vtable of a class (if it has a virtual function ) is created and loaded in memory 1. at the time of class declaration (before the 1st object of that class is created) 2. when the 1st object of that class is created 3. its compiler dependent .(not specified by c++ standard) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Sudoku
can anybody give me the steps you need to check while writing a program to simulate sudoku i don't want the exact codejust algorithm would me more than sufficient. suggest also the suitable languages for implementing that..VB or java or any other -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] IIS and ASP
guys, i have created a FILESYSTEM web site and created a connection with database in sql server 2008it worked fine but when i use the same connection string to connect a http website hosted on my IIS sever locally to the same databaseit says it cannot open the connection.please tell me whats wrong with my server when the same website worked fine earlier. please if somebody knows the problem then help meor can anyone give me the email id of some other groups or blogs on which questions related to ASP are discussed..it would be really helpful note--coding language-c# os=windows 7 iis version 6... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] sql triggers
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 based trigger and NOT ORACLE based. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] ASP connection prblm
if i use the connection string. sConn= Provider=SQLOLEDB;Integrated Security=SSPI;Trusted_Connection=yes;Initial Catalog=master;Connect Timeout=0;Data Source=VIVEK-PC then i am able to connect to master database in sql server 2008.. but if i use the connection string sConn= Provider=SQLOLEDB;Integrated Security=SSPI;Trusted_Connection=yes;Initial Catalog=pubs;Connect Timeout=0;Data Source=VIVEK-PC then it gives me error. Microsoft OLE DB Provider for SQL Server error '80004005' Cannot open database pubs requested by the login. The login failed. PS: I am using windows authenticationcan anybody tell me the how to correct this problem. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] ASP problem
plz reply.its imp. and urgent On Mon, Sep 12, 2011 at 8:47 PM, himanshu kansal himanshukansal...@gmail.com wrote: here is my full code.. the error is. Microsoft OLE DB Provider for SQL Server: Cannot open database pubs requested by the login. The login failed in the line with huge text.. % Dim oCmd Dim oCn Dim oRs Dim sConn Dim sProvider sConn= Provider=SQLOLEDB;Integrated Security=SSPI;Trusted_Connection=yes;Initial Catalog=pubs;Connect Timeout=0;Data Source=VIVEK-PC Set oCn = Server.CreateObject(ADODB.Connection) oCn.ConnectionString = sConn oCn.Open If oCn.errors.count = 0 Then Response.Write Connected OK Else Response.Write NOT Connected OK End If Set oCmd = CreateObject(ADODB.Command) Set oCmd.ActiveConnection = oCn oCmd.CommandText = select * from him oCmd.CommandType = 1 Set oRs = oCmd.Execute() oCn.close oRs.Close % On Mon, Sep 12, 2011 at 4:19 PM, Sanjay Rajpal srn...@gmail.com wrote: Same is available in VB also. Sanju :) On Mon, Sep 12, 2011 at 3:46 AM, himanshu kansal himanshukansal...@gmail.com wrote: i have that book:P:P is there any other good book relating to VB. On Mon, Sep 12, 2011 at 4:15 PM, Sanjay Rajpal srn...@gmail.comwrote: Apress Beginnin ASP.NET http://asp.net/ in C# 4.0. Sanju :) On Mon, Sep 12, 2011 at 3:40 AM, himanshu kansal himanshukansal...@gmail.com wrote: okk...i will post the connection string soonbut can anyone tell me the name of a good book on asp .net 3.5 for a newcomer. i am new to asp it would be very great if someone could also provide the link of the book here..' thanx in advance. On Mon, Sep 12, 2011 at 1:05 PM, Sanjay Rajpal srn...@gmail.comwrote: Post ur connection string here. Sanju :) On Mon, Sep 12, 2011 at 12:24 AM, himanshu kansal himanshukansal...@gmail.com wrote: I established a connection to a database in sql server 2008 through asp. the connection string is ok. i have checked it and even i have generated the connection from data link object and used that string but the error occurslogin failed for database pubs failed...unable to login i am using windows authentication mode. can this be a problem of database securitycan anybody tell me how to tackle with this problem.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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
[algogeeks] ASP problem
I established a connection to a database in sql server 2008 through asp. the connection string is ok. i have checked it and even i have generated the connection from data link object and used that string but the error occurslogin failed for database pubs failed...unable to login i am using windows authentication mode. can this be a problem of database securitycan anybody tell me how to tackle with this problem.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] ASP problem
okk...i will post the connection string soonbut can anyone tell me the name of a good book on asp .net 3.5 for a newcomer. i am new to asp it would be very great if someone could also provide the link of the book here..' thanx in advance. On Mon, Sep 12, 2011 at 1:05 PM, Sanjay Rajpal srn...@gmail.com wrote: Post ur connection string here. Sanju :) On Mon, Sep 12, 2011 at 12:24 AM, himanshu kansal himanshukansal...@gmail.com wrote: I established a connection to a database in sql server 2008 through asp. the connection string is ok. i have checked it and even i have generated the connection from data link object and used that string but the error occurslogin failed for database pubs failed...unable to login i am using windows authentication mode. can this be a problem of database securitycan anybody tell me how to tackle with this problem.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] ASP problem
i have that book:P:P is there any other good book relating to VB. On Mon, Sep 12, 2011 at 4:15 PM, Sanjay Rajpal srn...@gmail.com wrote: Apress Beginnin ASP.NET http://asp.net/ in C# 4.0. Sanju :) On Mon, Sep 12, 2011 at 3:40 AM, himanshu kansal himanshukansal...@gmail.com wrote: okk...i will post the connection string soonbut can anyone tell me the name of a good book on asp .net 3.5 for a newcomer. i am new to asp it would be very great if someone could also provide the link of the book here..' thanx in advance. On Mon, Sep 12, 2011 at 1:05 PM, Sanjay Rajpal srn...@gmail.comwrote: Post ur connection string here. Sanju :) On Mon, Sep 12, 2011 at 12:24 AM, himanshu kansal himanshukansal...@gmail.com wrote: I established a connection to a database in sql server 2008 through asp. the connection string is ok. i have checked it and even i have generated the connection from data link object and used that string but the error occurslogin failed for database pubs failed...unable to login i am using windows authentication mode. can this be a problem of database securitycan anybody tell me how to tackle with this problem.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] ASP problem
here is my full code.. the error is. Microsoft OLE DB Provider for SQL Server: Cannot open database pubs requested by the login. The login failed in the line with huge text.. % Dim oCmd Dim oCn Dim oRs Dim sConn Dim sProvider sConn= Provider=SQLOLEDB;Integrated Security=SSPI;Trusted_Connection=yes;Initial Catalog=pubs;Connect Timeout=0;Data Source=VIVEK-PC Set oCn = Server.CreateObject(ADODB.Connection) oCn.ConnectionString = sConn oCn.Open If oCn.errors.count = 0 Then Response.Write Connected OK Else Response.Write NOT Connected OK End If Set oCmd = CreateObject(ADODB.Command) Set oCmd.ActiveConnection = oCn oCmd.CommandText = select * from him oCmd.CommandType = 1 Set oRs = oCmd.Execute() oCn.close oRs.Close % On Mon, Sep 12, 2011 at 4:19 PM, Sanjay Rajpal srn...@gmail.com wrote: Same is available in VB also. Sanju :) On Mon, Sep 12, 2011 at 3:46 AM, himanshu kansal himanshukansal...@gmail.com wrote: i have that book:P:P is there any other good book relating to VB. On Mon, Sep 12, 2011 at 4:15 PM, Sanjay Rajpal srn...@gmail.comwrote: Apress Beginnin ASP.NET http://asp.net/ in C# 4.0. Sanju :) On Mon, Sep 12, 2011 at 3:40 AM, himanshu kansal himanshukansal...@gmail.com wrote: okk...i will post the connection string soonbut can anyone tell me the name of a good book on asp .net 3.5 for a newcomer. i am new to asp it would be very great if someone could also provide the link of the book here..' thanx in advance. On Mon, Sep 12, 2011 at 1:05 PM, Sanjay Rajpal srn...@gmail.comwrote: Post ur connection string here. Sanju :) On Mon, Sep 12, 2011 at 12:24 AM, himanshu kansal himanshukansal...@gmail.com wrote: I established a connection to a database in sql server 2008 through asp. the connection string is ok. i have checked it and even i have generated the connection from data link object and used that string but the error occurslogin failed for database pubs failed...unable to login i am using windows authentication mode. can this be a problem of database securitycan anybody tell me how to tackle with this problem.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
sizeof is nt defined for function typeundefined reslt On Tue, Sep 6, 2011 at 11:21 PM, siddharam suresh siddharam@gmail.comwrote: *main()* is an address/probably the function pointer, Thank you, Sid. On Tue, Sep 6, 2011 at 11:19 PM, Sanjay Rajpal srn...@gmail.com wrote: #include stdio.h #includeconio.h int main() { printf( %d,sizeof(main())); ... getche(); return 0; } o/p is 4..how ??? Sanju :) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] c problem
an array is always an *unmodifiable* l-value. On Sat, Sep 3, 2011 at 6:23 PM, priya ramesh love.for.programm...@gmail.com wrote: In main, any array say char a[200], a refers to an r value or an lvalue?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] c question
array is always given a special treatment...its nt a constant ptrits an array means 100 bytes r resrvd for it for this i think u mst go thru pointers in c and ritchi books. On Sat, Sep 3, 2011 at 6:41 PM, priya ramesh love.for.programm...@gmail.com wrote: foo(char []s){ printf(%d, sizeof(s)); } even now it prints 4. My point is s pointer in foo and a is also a constant pointer in main. (a is passed to foo) However, in main a is treated as an rvalue and in s the same pointer is an lvalue. why?? Someone plz reply. It's urgent -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C doubt
cz when u do char p[]=hello compiler automatically allocates enough memory(6 charc here) and puts your string there.. but whn u do char*a=hello then its complr dependent where d string will be storedsome compiler stores it in a special location in data segmnt whch is (read only )so modifying the string is errorother compiler stores it in write allowed memory so u can alter d string there... On Sun, Aug 28, 2011 at 5:02 PM, rohit raman.u...@gmail.com wrote: Why does the following code not give an error? #includestdio.h void fun(char *a) //array decays to pointer here { a[0] = 'a'; printf(%s\n,a); } int main() { char p[]=hello; fun(p); getch(); } if i write something like this in main char *arr=hello arr[0] = 'r'; //this gives runtime error and i know why -- 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/-/rxboAmI8lEUJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C doubt
because when u pass an array, the address of memory location that is recievd in the func is accessible and write allowed also to u..so u dont get an error On Sun, Aug 28, 2011 at 5:17 PM, rohit raman.u...@gmail.com wrote: Thanks for your reply himanshu, ...I am aware of the above stated fact but my doubt is that when i pass this char array to a function and accept it as a char pointer (char *a), and then when write a[0] = 'a', why don't i get an error? -- 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/-/uoEq0N1M1t0J. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] algo ques
you have a path of N steps at every step, you can take onl;y 1 step or 2 steps. how to print all the possible paths that you can take.. PS: please dont give the exact code.your approaches will be appreciated:) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C output
i think this must have produced a warning..conversion from const char * to char*... On Tue, Aug 16, 2011 at 8:52 PM, Sanjay Rajpal sanjay.raj...@live.inwrote: This is becuase Hello is a constant string and constant strings get stored in *Data Area, not in stack for the function you called. *Thats why pointer to constant string will be returned and program will not produce any error. Sanjay Kumar B.Tech Final Year Department of Computer Engineering National Institute of Technology Kurukshetra Kurukshetra - 136119 Haryana, India On Tue, Aug 16, 2011 at 8:19 AM, rohit raman.u...@gmail.com wrote: #includestdio.hconst char *fun(); int main() { char *ptr = fun(); return 0; }const char *fun() { return Hello; } Why doesn't this code give error?? -- 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/-/qeUTNwGNKfwJ. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] destructor
d destructor can be called explicitly but u *should never* do that... reason: a destructor is caaled automatically when its scope endsthere is no way of preventing its call. so if u have called it explicitly also then u can be in a *serious problem*if ur destructor deallocates memory.:):P On Sun, Aug 14, 2011 at 10:47 AM, Aashish aashish.barn...@gmail.com wrote: can we call a destructor in our own defined class explicitly or it will be executed automatically ? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] simple doubt
i think 1st is wrong bt 2nd is correct.. On Fri, Aug 5, 2011 at 9:51 PM, nishaanth nishaant...@gmail.com wrote: i think both are erroneous. first statement i think you are trying to change the array address which is not possible. second statementarr doesn't make any sense i guess arr gives the address but arr is not allowed On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: but u initialized **dp means . ex-dp=p and p=arr then its correct so dp contains addr of p which inturns contains addrof arr now **dp is correct initialization. On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Amazon Question
okie...can someone do it in O(n) space...bt time shld be linear only On Thu, Aug 4, 2011 at 2:13 AM, Prakash D cegprak...@gmail.com wrote: O(1) space is t hard for this task On Thu, Aug 4, 2011 at 12:55 AM, payel roy smithpa...@gmail.com wrote: Is there any solution for the above? On 3 August 2011 21:09, coder coder i.code.program...@gmail.com wrote: ya amazon will be visiting our campus within few days -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] interview ques
Create a database schema for storing Unix permissions. Create a database schema for storing newspaper reports. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Interview ques
how will you protect a base class to override its member function in derived class say if there is a function f() in base class then derived cannot override f() to provide its own definition. The function must be accessible in derived class. PS:dont try to make the function private in base class( it will be become inaccessible in derived class). -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Interview ques
sry i thinki misspelled d ques d ques was how will you protect a derived class to override base class's member function in c++ say if there is a function f() in base class then derived should not be able to override f() to provide its own definition. but The function must be accessible in derived class. PS:dont try to make the function private in base class( it will be become inaccessible in derived class). On Sun, Jul 31, 2011 at 7:49 PM, himanshu kansal himanshukansal...@gmail.com wrote: how will you protect a base class to override its member function in derived class say if there is a function f() in base class then derived cannot override f() to provide its own definition. The function must be accessible in derived class. PS:dont try to make the function private in base class( it will be become inaccessible in derived class). -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Interview ques
i think there is no keyword known as final in c++.maybe u are talking with respect to java On Sun, Jul 31, 2011 at 8:03 PM, muthu raj muthura...@gmail.com wrote: By declaring the function a static final f(). *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Sun, Jul 31, 2011 at 7:28 AM, himanshu kansal himanshukansal...@gmail.com wrote: sry i thinki misspelled d ques d ques was how will you protect a derived class to override base class's member function in c++ say if there is a function f() in base class then derived should not be able to override f() to provide its own definition. but The function must be accessible in derived class. PS:dont try to make the function private in base class( it will be become inaccessible in derived class). On Sun, Jul 31, 2011 at 7:49 PM, himanshu kansal himanshukansal...@gmail.com wrote: how will you protect a base class to override its member function in derived class say if there is a function f() in base class then derived cannot override f() to provide its own definition. The function must be accessible in derived class. PS:dont try to make the function private in base class( it will be become inaccessible in derived class). -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Interview ques
how to find a duplicate in a very large file. i gave two approaches Hashing and buliding a BST can anyone suggest another more efficient approach. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: interview ques
@bharath: yeah i was also thinking that we could store a pointer to a data block in which multiple records can be stored.but i think for searching a record we have to 1st get to that block and then search the record in that block On Thu, Jul 28, 2011 at 5:31 PM, bharath bharath.sri...@gmail.com wrote: @Puneet, to store anything on a machine, you will need to have a pointer to it else there is no question of accessing it. I am guessing the question emphasized on reducing the size of the B+ tree. Also, with B+ trees, you have sequence pointers at the data record level. Therefore, if these data records are stored in a single chunk, bringing the chunk into memeory is good enough. An additional storage structure will not be required. On Jul 28, 1:27 am, Puneet Gautam puneet.nsi...@gmail.com wrote: @bharath: To store the bunch of records together also, we gonna need another useful ds like linked list or array which again points to the problem of excessive storage or excessive pointers... correct me if am not..! On 7/28/11, bharath bharath.sri...@gmail.com wrote: @Dumanshu: A B+ tree is a multi-level index. It indexes the index until the final level is small enough to fit into a data block that can fit in memory. On Jul 27, 10:11 pm, Dumanshu duman...@gmail.com wrote: Use multilevel indexing On Jul 27, 11:07 pm, himanshu kansal himanshukansal...@gmail.com wrote: if u hv say 20 million records and u have to create a b+ tree then you might be storing 20 million pointers at the leaf levelhow can u optimize this(using b+ tree only)??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] interview ques
if u hv say 20 million records and u have to create a b+ tree then you might be storing 20 million pointers at the leaf levelhow can u optimize this(using b+ tree only)??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] c++ doubt
class a { int x; public: a() { } a(int i){x=i;coutin a xendl;} a(a obj){coutin copy cons of aendl;} }; a obj1=14; //error no matching call to a::a(a) why. and just adding a const in the constructor saves me from error...but how -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] c++ doubt
a obj3(obj1);but this statement works fine.so it means it is calling copy constt. perfectly... On Sun, Jul 10, 2011 at 11:49 PM, rahul rahulr...@gmail.com wrote: my badadd const in copy construcori think...that compiler expect... On Sun, Jul 10, 2011 at 11:48 PM, rahul rahulr...@gmail.com wrote: use a(int arg) { x = arg; } ur call will work...:) On Sun, Jul 10, 2011 at 11:46 PM, himanshu kansal himanshukansal...@gmail.com wrote: class a { int x; public: a() { } a(int i){x=i;coutin a xendl;} a(a obj){coutin copy cons of aendl;} }; a obj1=14; //error no matching call to a::a(a) why. and just adding a const in the constructor saves me from error...but how -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] c++ doubt
thanku sir...sir 1 more thngcn u gv a link or some pdf for studying virtual inheritance elaborating the vptr mechanism more clearly... On Sun, Jul 10, 2011 at 11:56 PM, Sandeep Jain sandeep6...@gmail.comwrote: The reason is... that when u write a obj1=14; it is same as writing a obj1 = a(14); So first a temporary object is created using the constructor a(int i) And this temporary object is passed in the copy constructor. BUT since it is temp object it must be referred by a const alias. Regards, Sandeep Jain On Sun, Jul 10, 2011 at 11:52 PM, himanshu kansal himanshukansal...@gmail.com wrote: a obj3(obj1);but this statement works fine.so it means it is calling copy constt. perfectly... On Sun, Jul 10, 2011 at 11:49 PM, rahul rahulr...@gmail.com wrote: my badadd const in copy construcori think...that compiler expect... On Sun, Jul 10, 2011 at 11:48 PM, rahul rahulr...@gmail.com wrote: use a(int arg) { x = arg; } ur call will work...:) On Sun, Jul 10, 2011 at 11:46 PM, himanshu kansal himanshukansal...@gmail.com wrote: class a { int x; public: a() { } a(int i){x=i;coutin a xendl;} a(a obj){coutin copy cons of aendl;} }; a obj1=14; //error no matching call to a::a(a) why. and just adding a const in the constructor saves me from error...but how -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: VIRTUAL INHERITANCE
@piyush:what does this two virtual pointers storing???nd how does they help in eliminating ambiguity?? On Mon, Jul 4, 2011 at 4:08 AM, T3rminal piyush@gmail.com wrote: @abc abc 4th class= two ints from X and Y classes + one int from base class( as this class is shared ) + 2 virtual pointers of X and Y classes. On Jul 3, 2:24 pm, abc abc may.i.answ...@gmail.com wrote: In the second case , the size of vptr will be added to each and every object . 1st class = one int :4 2nd class = one int +one int from base + vptr =12 3rd class = one int + one int from base + vptr =12 4th class =one int from each base class + one int from each of the grand parent +one vptr =20 On Sun, Jul 3, 2011 at 2:43 PM, himanshu kansal himanshukansal...@gmail.com wrote: class Base { public: int a; }; class X: public Base { public: int x; }; class Y: public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 8 8 16... which is absolutely fine. but the problem arises here class Base { public: int a; }; class X:virtual public Base { public: int x; }; class Y:virtual public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 12 12 20 why the size is 12 and 20 for x and Zdoes this is because that some sort of VPTR IS maintained in the classif yes then then what does that points to PS:HERE.i am talking about virtual inheritanceNOT ABOUT VIRTUAL FUNCTIONS... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] function overloading in inheritance
class A { public: void g(int i) { coutin a; } }; class B:public A { public: void f() { coutin b; } }; int main() { B b; b.f(); //vl call b::f() b.g(4); //vl call a::g() } but class A { public: void f(int i) { coutin a; } }; class B:public A { public: void f() { coutin b; } }; int main() { B b; b.f(); //vl call b::f() b.f(4); //bt here errror occurs not a matching protoype... } my ques is that cant we overload function in inheritance(which vary in parameters)..??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] function overloading in inheritance
Thanku sir...:) On Mon, Jul 4, 2011 at 1:59 PM, Sandeep Jain sandeep6...@gmail.com wrote: This happens because the Derived class's member *hides* the base class's member. Irrespective of the number/type of parameters. The solution to solve this problem is to either add an using declaration in the derived class. e.g. *using A::f;* this will bring f(int) of class A within the scope of class B, and thus allowing the overload to work or you need to use the scope resolution operator to explicitly call class A's hidden function. e.g. *b.A::f(4);* Hope this helps. Regards, Sandeep Jain Member of Technical Staff, Adobe Systems, India On Mon, Jul 4, 2011 at 12:42 PM, himanshu kansal himanshukansal...@gmail.com wrote: class A { public: void g(int i) { coutin a; } }; class B:public A { public: void f() { coutin b; } }; int main() { B b; b.f(); //vl call b::f() b.g(4); //vl call a::g() } but class A { public: void f(int i) { coutin a; } }; class B:public A { public: void f() { coutin b; } }; int main() { B b; b.f(); //vl call b::f() b.f(4); //bt here errror occurs not a matching protoype... } my ques is that cant we overload function in inheritance(which vary in parameters)..??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] VIRTUAL INHERITANCE
class Base { public: int a; }; class X: public Base { public: int x; }; class Y: public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 8 8 16... which is absolutely fine. but the problem arises here class Base { public: int a; }; class X:virtual public Base { public: int x; }; class Y:virtual public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 12 12 20 why the size is 12 and 20 for x and Zdoes this is because that some sort of VPTR IS maintained in the classif yes then then what does that points to PS:HERE.i am talking about virtual inheritanceNOT ABOUT VIRTUAL FUNCTIONS... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: VIRTUAL INHERITANCE
1 MORE QUESHOW IS DELEGATED TO SISTER CLASS IMPLEMENTED...MEANS HOW CAN ONE CLASS CALL ANOTHER CLASS'S FUNCTION WITHOUT KNOWING ANYTHING ABOUT IT On Sun, Jul 3, 2011 at 2:43 PM, himanshu kansal himanshukansal...@gmail.com wrote: class Base { public: int a; }; class X: public Base { public: int x; }; class Y: public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 8 8 16... which is absolutely fine. but the problem arises here class Base { public: int a; }; class X:virtual public Base { public: int x; }; class Y:virtual public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 12 12 20 why the size is 12 and 20 for x and Zdoes this is because that some sort of VPTR IS maintained in the classif yes then then what does that points to PS:HERE.i am talking about virtual inheritanceNOT ABOUT VIRTUAL FUNCTIONS... -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] VIRTUAL INHERITANCE
shouldnt it be 16cz only one instance of base class gets included when we use virtual keyword.. On Sun, Jul 3, 2011 at 2:54 PM, abc abc may.i.answ...@gmail.com wrote: In the second case , the size of vptr will be added to each and every object . 1st class = one int :4 2nd class = one int +one int from base + vptr =12 3rd class = one int + one int from base + vptr =12 4th class =one int from each base class + one int from each of the grand parent +one vptr =20 On Sun, Jul 3, 2011 at 2:43 PM, himanshu kansal himanshukansal...@gmail.com wrote: class Base { public: int a; }; class X: public Base { public: int x; }; class Y: public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 8 8 16... which is absolutely fine. but the problem arises here class Base { public: int a; }; class X:virtual public Base { public: int x; }; class Y:virtual public Base { public: int y; }; class Z:public X,public Y { }; int main() {coutsizeof(Base)endl; cout sizeof(X) endl; cout sizeof(Y) endl; cout sizeof(Z) endl; } o/p is 4 12 12 20 why the size is 12 and 20 for x and Zdoes this is because that some sort of VPTR IS maintained in the classif yes then then what does that points to PS:HERE.i am talking about virtual inheritanceNOT ABOUT VIRTUAL FUNCTIONS... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: conditional compilation
Ya its cleard nw.. Thnx..:) On 7/2/11, Dumanshu duman...@gmail.com wrote: In ur second code change int i=2 and run it. It would still print bye. check the result of preprocessor using -E flag. On Jun 30, 4:46 pm, himanshu kansal himanshukansal...@gmail.com wrote: 1 more thngif its possible to eval. variable expression lyk abv... thn... int i=2; #if i==2 printf(hi); #else printf(bye); //prints byei think it shld print hi... #endif even this code prints bye. int i=3; #if i==2 printf(hi); #else printf(bye); #endif On Thu, Jun 30, 2011 at 5:13 PM, himanshu kansal himanshukansal...@gmail.com wrote: somewhere i read dt conditional compilation such as #if and #elif etc cn only use constant expressions and previously defined macrosthey cant use variables cz preprocessng is done b4 compilation... bt whn i try it on gcc and vc both r compiling it with variables abs. fyneven disabling extensions dint work i.e int i; #if i+1 printf(hi); vl print hi...no error occurs #endif thn i read it on net dt it cn eval. varables also nw m confused who is ryt... whtr it cn eval var also or nt... nd if it cn thn hws it possible dt preprocessor knows d val. of var. b4 compiling d prog... -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: conditional compilation
If i do #if i==0 thn it vl cmpl it..means its tkng it as 0..bt why... On 7/1/11, Dumanshu duman...@gmail.com wrote: i think it will take a garbage value for i because these are preprocessor directives. On Jun 30, 4:46 pm, himanshu kansal himanshukansal...@gmail.com wrote: 1 more thngif its possible to eval. variable expression lyk abv... thn... int i=2; #if i==2 printf(hi); #else printf(bye); //prints byei think it shld print hi... #endif even this code prints bye. int i=3; #if i==2 printf(hi); #else printf(bye); #endif On Thu, Jun 30, 2011 at 5:13 PM, himanshu kansal himanshukansal...@gmail.com wrote: somewhere i read dt conditional compilation such as #if and #elif etc cn only use constant expressions and previously defined macrosthey cant use variables cz preprocessng is done b4 compilation... bt whn i try it on gcc and vc both r compiling it with variables abs. fyneven disabling extensions dint work i.e int i; #if i+1 printf(hi); vl print hi...no error occurs #endif thn i read it on net dt it cn eval. varables also nw m confused who is ryt... whtr it cn eval var also or nt... nd if it cn thn hws it possible dt preprocessor knows d val. of var. b4 compiling d prog... -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: meaning of null in output
Guys..plz wake up nd reply to ths thread... On 6/30/11, himanshu kansal himanshukansal...@gmail.com wrote: what is meaning of (null) in d output in cnd what r d possible reason nd causes for dt -- Sent from my mobile device Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] meaning of null in output
what is meaning of (null) in d output in cnd what r d possible reason nd causes for dt -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] conditional compilation
somewhere i read dt conditional compilation such as #if and #elif etc cn only use constant expressions and previously defined macrosthey cant use variables cz preprocessng is done b4 compilation... bt whn i try it on gcc and vc both r compiling it with variables abs. fyneven disabling extensions dint work i.e int i; #if i+1 printf(hi); vl print hi...no error occurs #endif thn i read it on net dt it cn eval. varables also nw m confused who is ryt... whtr it cn eval var also or nt... nd if it cn thn hws it possible dt preprocessor knows d val. of var. b4 compiling d prog... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: conditional compilation
1 more thngif its possible to eval. variable expression lyk abv... thn... int i=2; #if i==2 printf(hi); #else printf(bye); //prints byei think it shld print hi... #endif even this code prints bye. int i=3; #if i==2 printf(hi); #else printf(bye); #endif On Thu, Jun 30, 2011 at 5:13 PM, himanshu kansal himanshukansal...@gmail.com wrote: somewhere i read dt conditional compilation such as #if and #elif etc cn only use constant expressions and previously defined macrosthey cant use variables cz preprocessng is done b4 compilation... bt whn i try it on gcc and vc both r compiling it with variables abs. fyneven disabling extensions dint work i.e int i; #if i+1 printf(hi); vl print hi...no error occurs #endif thn i read it on net dt it cn eval. varables also nw m confused who is ryt... whtr it cn eval var also or nt... nd if it cn thn hws it possible dt preprocessor knows d val. of var. b4 compiling d prog... -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: c query
can nyone xplain me dt whats d meaning of (null) in d output...cz m getting (null) 0.0 for d abv ques On Fri, Jun 24, 2011 at 8:41 PM, oppilas . jatka.oppimi...@gmail.comwrote: Please see this. http://ideone.com/ZM74d http://ideone.com/ZM74dI tried to print by directly giving 2[*arr] still it's giving null and 0.000. Can anyone think of a possible reason? On Fri, Jun 24, 2011 at 8:27 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @ T3rminal That is because the term is resolved as 2[*arr] which is pointing to the structure variable 'c' of type 'job' So 'n' format specifiers should be used to print n values of a structure and that to in sequence of declarations in the structure . Hope this helps :) Regards Rajeev N B I Blog @ www.opensourcemania.co.cc On Fri, Jun 24, 2011 at 4:10 AM, T3rminal piyush@gmail.com wrote: How printf can print 2 values for %s and %f if you provided only 1 (3,x1)[*arr] ? On Jun 24, 12:13 am, Anika Jain anika.jai...@gmail.com wrote: #includestdio.h typedef struct { char *name; double salary;}job; main() { static job a={tcs,15000.0}; static job b={ibm,25000.0}; static job c={google,35000.0}; int x=5; job *arr[3]={a,b,c}; printf(%s %f\t,(3,x1)[*arr]); } it is giving google 35000.00 there's no error.. i think u r doing some mistake by not writing %s as format specifier in printing.. On Thu, Jun 23, 2011 at 8:20 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: even I am getting output as google 0.0 On 6/23/11, Bhavesh agrawal agr.bhav...@gmail.com wrote: i got (null) 0.0 on my gcc compiler , is there any syntax error -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926* -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] can void pointer be incremented
can v increment d void pointer its perfectly valid on gcc bt it gives me an error on vc so is it allowed by c standard or its an extension provided by gnu??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: can void pointer be incremented
one more...gcc allows void ptr to be assigned to and frm any type of ptr w/o any cast bt vc gvs an error and requires an explicit cast... whots d specifications abt ds as conforming to c standards.. On Fri, Jun 24, 2011 at 6:25 PM, himanshu kansal himanshukansal...@gmail.com wrote: can v increment d void pointer its perfectly valid on gcc bt it gives me an error on vc so is it allowed by c standard or its an extension provided by gnu??? -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] sort the array
@anika: yar merge sort vl tk nlogn timeinstead u cn do dt maintain two ptrs one at the beginning and one intitially pointing to middle of the array... thn compare the elemnts pointed by them and swap the values if necesary nd incremnt d ptr as u go on... ths vl tk (n/2)+(n/2)-1 =O(n) time corrct me if m wrong On Tue, Jun 21, 2011 at 10:56 PM, Anika Jain anika.jai...@gmail.com wrote: its like inplace mergesort On Tue, Jun 21, 2011 at 10:13 PM, aanchal goyal goyal.aanch...@gmail.comwrote: you have an array of size n where first n/2 is sorted and the sencond half is sorted . You need to sort the entire array inplace Its second modification version is where first part is sorted and other is NOT sorted . You need to make entire sorted . -- Regards,* Aanchal Goyal*. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] preincrement and post increment
int val; int *p=val; why does (++val)++ gives err in c bt nt in c++. i knw dt abv expression wd produce undefined results bt i just want to knw why its nt giving the err in c++ 2nd ques is whn ++val++ is invalid thn why ++*p++ is valid does it hv something to do wd references?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] hw can argv be incremented
char *a[10]; a++;//lvalue reqd error.. i knw dt base address f array cnt be incremented. bt following code compiles succesfully int main(int argc, char *argv[]) { printf(%s, *++argv); } can some one xplain why this is happening similarly int foo(int *blah[10]) { int *f[10]; blah++; //no error f++;//error } whyyy does ds because an array as a function arg. decays into a pointer.??? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] nan in c
how the value of Nan is stored internally 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] MS question
in c str[i] can be indexed using anthr notation i.e i[str] also bt m nt getting hw hello! how is this gets printedsince its format specifier i.e %s occurs aftr the string... On Thu, Jun 2, 2011 at 11:40 PM, Balaji S balaji.ceg...@gmail.com wrote: how s that output obtained?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal Msc Comp. sc. (University of Delhi) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] c output
a=++b*++b; if b=3 initially, then a is coming out to be 25.why -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: island puzzle
guys wake up On Fri, May 27, 2011 at 9:24 PM, himanshu kansal himanshukansal...@gmail.com wrote: 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 solved it if the no of islands are even bt nt getting any clue whn no of islands are odd in the odd casei think bob vl hv an advantage ovr ericbut how to develop strategy for eric(if no of islands are odd) -- Regards Himanshu Kansal MCS-DU -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: suitable data structure
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 dictionary file againif d word is nt found in collection of wrong words thn v hv to scan d entire dictionary file On Fri, May 27, 2011 at 1:07 PM, bittu shashank7andr...@gmail.com wrote: @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 group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal MCS-DU -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] island puzzle
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 solved it if the no of islands are even bt nt getting any clue whn no of islands are odd in the odd casei think bob vl hv an advantage ovr ericbut how to develop strategy for eric(if no of islands are odd) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] suitable data structure
if a large no of documents are available and need to find out the spelling errors.for this the words are compared wd a dictionary fileif a word is nt present in dictionary thn it is sure dt d word is wrong...thn v hv to print d no of occurences of the wrong wordassuming dt d word vl occur frquently in d file nd wd b wrong everytimewhch data structure wd b best suited for storing d wrong wordsso tht v cn find whthr a wrd is wrong wdout scanning the dictionary -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...
at http://groups.google.com/group/algogeeks?hl=en. -- Regards Himanshu Kansal MCS-DU -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] problem regarding gcc installation
i am using ubuntu 8.04 nd currently installed gcc 4.2 do anyone knws the steps of installing gcc of version greater thn 4.4 on ubuntu 8.04. i hv searched a lot on net bt couldnt find 1... -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] problem regarding gcc installation
yeah i knw dt well...bt i jus asked if sum1 cd help me On Sat, Apr 30, 2011 at 12:20 AM, Charles Turner chtu...@gmail.com wrote: On 29/04/2011 19:31, himanshu kansal wrote: i am using ubuntu 8.04 nd currently installed gcc 4.2 do anyone knws the steps of installing gcc of version greater thn 4.4 on ubuntu 8.04. i hv searched a lot on net bt couldnt find 1... This is *not* the correct mailing list to ask such questions. I'd suggest you ask either a Ubuntu or GCC oriented list. Thank you for your cooperation. Charles. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re:
Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards, Arpit Sood -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Umer -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Arpit Bhatnagar (MNIT JAIPUR) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Virtual classes
can u gv any link for reference...??? On Sat, Mar 26, 2011 at 12:29 PM, D.N.Vishwakarma@IITR deok...@gmail.comwrote: *there is vtable known as virtual table which contains addresses of virtual functions . And there is vptr a pointer that points to vtable of that class space occupied by class having virtual function wil be equal to space occupied by a pointer * number of virtual functions .. I think this if there is any correction please let me know... * On Sat, Mar 26, 2011 at 12:00 PM, himanshu kansal himanshukansal...@gmail.com wrote: wht is the space occupied by a class in c++ whn it contains a virtual fn. How are the virtual fn implemented internally by 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *With Regards Deoki Nandan Vishwakarma IITR MCA Mathematics Department * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Virtual classes
wht is the space occupied by a class in c++ whn it contains a virtual fn. How are the virtual fn implemented internally by 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Print Hello
is this possible in c also On Wed, Mar 16, 2011 at 11:57 PM, Manikanta manikantabab...@gmail.comwrote: Thats right in C++. How about in C. On Mar 16, 9:44 pm, kumar anurag anurag.it.jo...@gmail.com wrote: @anurag good. On Wed, Mar 16, 2011 at 9:28 PM, Anurag atri anu.anurag@gmail.com wrote: #includeiostream using namespace std ; class a { public : a() { couthello;} }a1; int main() { } On Wed, Mar 16, 2011 at 8:25 PM, himanshu kansal himanshukansal...@gmail.com wrote: How can u print hello in a c/c++ program without writing a single word in main() function -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Anurag Atri -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Kumar Anurag- Hide quoted text - - Show quoted text - -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Print Hello
is there any way to print hello in c also wdout writing anythng in main() On Thu, Mar 17, 2011 at 6:34 PM, kunal srivastav kunal.shrivas...@gmail.com wrote: n...c does not support classes On Thu, Mar 17, 2011 at 6:10 PM, himanshu kansal himanshukansal...@gmail.com wrote: is this possible in c also On Wed, Mar 16, 2011 at 11:57 PM, Manikanta manikantabab...@gmail.comwrote: Thats right in C++. How about in C. On Mar 16, 9:44 pm, kumar anurag anurag.it.jo...@gmail.com wrote: @anurag good. On Wed, Mar 16, 2011 at 9:28 PM, Anurag atri anu.anurag@gmail.com wrote: #includeiostream using namespace std ; class a { public : a() { couthello;} }a1; int main() { } On Wed, Mar 16, 2011 at 8:25 PM, himanshu kansal himanshukansal...@gmail.com wrote: How can u print hello in a c/c++ program without writing a single word in main() function -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Anurag Atri -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Kumar Anurag- Hide quoted text - - Show quoted text - -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thezeitgeistmovement.com -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] linked list
can nodes of linked list in c/c++ contain different types of datameans suppose 1st node of the list contains an integer value, 2nd contains a float,3rd has a string and so on.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Print Hello
How can u print hello in a c/c++ program without writing a single word in main() function -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] How to print numbers from 1 to 100 without loop , without recursion , without #define statements , without goto statement
class arr {static int i; public: arr() { couti++; } }; int arr::i=1; int main() { arr a[100]; } On Wed, Mar 16, 2011 at 9:47 PM, kumar anurag anurag.it.jo...@gmail.comwrote: using two different functions calling one another ? like fun1() { fun2() } fun2() { fun1(); } On Wed, Mar 16, 2011 at 9:39 PM, D.N.Vishwakarma@IITR deok...@gmail.comwrote: * * -- *With Regards Deoki Nandan Vishwakarma IITR MCA Mathematics Department * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Kumar Anurag -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.