Re: [algogeeks] Re: Network Question

2011-09-03 Thread sagar pareek
yeah the same problem i facing that if two same ip/s with diff subnets in same LAN can't create any problem?? On Sat, Sep 3, 2011 at 11:05 AM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > I didn't understand "so subnet 10.0.1.0/26 cannot communicate with > 10.0.1.0/24 > > having s

Re: [algogeeks] Re: Network Question

2011-09-03 Thread sukran dhawan
even searching is efficient in trie !! On Sat, Sep 3, 2011 at 12:40 PM, sagar pareek wrote: > yeah the same problem i facing that if two same ip/s with diff subnets in > same LAN can't create any problem?? > > > On Sat, Sep 3, 2011 at 11:05 AM, bharatkumar bagana < > bagana.bharatku...@gmail.co

Re: [algogeeks] Re: Need algorithm asap

2011-09-03 Thread mohit verma
Here is my soluion . void bipartition(int a[],int p,int max) { if(p==max){return ;} p++; for(int i=p;i wrote: > no of valid bipartitions are 2^n, thats what he meant I guess... ( if you > do not want null set as one of the partitions then subtract 1 from > answer...) > > -- > You received this

Re: [algogeeks] dictionary

2011-09-03 Thread Nitin
I think b-tree would help you... On Sat, Sep 3, 2011 at 9:47 AM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > WHY trie? any reason ? > Dictionary means not only to save efficiently and also we have to get back > in almost O(1) time .. I think Hash Table is best suited for this... O

Re: [algogeeks] Re: Need algorithm asap

2011-09-03 Thread mohit verma
> > this line is unnecessary > > if(result[i]==1) continue; > I think this algo is good enough. But any improvements? -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group,

[algogeeks] Re: Network Question

2011-09-03 Thread Vengadanathan
yeah the ip's in a LAN must be unique to communicate between them if u want to have subnet having ip address range of another subnet or supernet try using NAT to resolve the issue ... On Sep 3, 10:35 am, bharatkumar bagana wrote: > I didn't understand "so subnet 10.0.1.0/26 cannot communicat

[algogeeks] ebay questions...

2011-09-03 Thread htross
hi everyone, ebay is coming to our college this week,so please post whattype of questions will be asked in written round. post some sample questions also... -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this grou

[algogeeks] MICROSOFT

2011-09-03 Thread teja bala
Design the data structures for an online book reader system ? We can implement it by using trie data structure but is der any other data structure that is more efficient> plzz explain it in more elaborated way . -- You received this message because you are subscribed to the Googl

[algogeeks] memory allocation question

2011-09-03 Thread rohit
how many bytes are allocated by following code? #include #define col 4 #define row 3 int main() { int(*p)[col]; p=(int(*)[col])malloc(row*sizeof(*p)); return 0; } please explain answer? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To p

Re: [algogeeks] Please explain its working..

2011-09-03 Thread annarao kataru
@sanjay then why to put str in printf statement . is there no effect of placing str in printf stat . plz clarify?? -- 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 u

Re: [algogeeks] Re: amazon question

2011-09-03 Thread annarao kataru
@sagar for one time u r taking the return value of newly created process and for other time u r taking return value of parentir it right?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks

Re: [algogeeks] Book Request <>

2011-09-03 Thread Amit Mittal
Please upload this book, if anyone of you have it. On Fri, Aug 19, 2011 at 7:59 AM, Swati Sarraf wrote: > Hey Navneet , which book are you talking abt- Data structure and algo made > easy OR Data structure Puzzles ? > > >

[algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread vikas
DON's solution will work On Sep 3, 11:28 am, Abhishek Yadav wrote: > this solution works if parent pointer is given. > 1. Start moving up from both the nodes (if two nodes become equal, fine this > is the common ancestor) till you reach the root node and in between count > the number of nodes you

Re: [algogeeks] Re: Network Question

2011-09-03 Thread priya ramesh
If there are two LANS, lan1 and lan2, both lans can make use of same addresses. however lan1 and lan2 must make use of NAT to comminicate with each other. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to al

[algogeeks] c question

2011-09-03 Thread priya ramesh
In any C program, int main(){ char a[100]; foo(a); printf("%d", sizeof(a)); } foo(char *s){ printf("%d", sizeof(a)); } In main sizeof a is 100, in foo it is 4. why?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send

[algogeeks] c problem

2011-09-03 Thread priya ramesh
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 algogeek

[algogeeks] arrays in c

2011-09-03 Thread priya ramesh
main(){ char arr="algogeeks\0"; arr++; } y does the compiler complain l value required in line 3.?? arr is a pointer holding address. This address is an lvalue. Why is it complaining?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post

Re: [algogeeks] Book Request <>

2011-09-03 Thread Rahul Verma
download the book from: http://www.scribd.com/doc/50658450/Data-Structures-and-Algorithms-Made-Easy-For-Interviews-Programming-Interview-Questions -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit http

Re: [algogeeks] c question

2011-09-03 Thread rajul jain
foo(char *s){ printf("%d", sizeof(s)); // correction } in this function foo s is a pointer so it print size of pointer which is 4 . On Sat, Sep 3, 2011 at 6:22 PM, priya ramesh wrote: > In any C program, > int main(){ > char a[100]; > foo(a); > printf("%d", sizeof(a)); > } > foo(char *s){ > p

Re: [algogeeks] Book Request <>

2011-09-03 Thread Amit Mittal
Rahul, This is not the complete book, it has just two chapters. Can you provide a link for the entire book ? On Sat, Sep 3, 2011 at 6:28 PM, Rahul Verma wrote: > download the book from: > http://www.scribd.com/doc/50658450/Data-Structures-and-Algorithms-Made-Easy-For-Interviews-Programming-Inter

Re: [algogeeks] c question

2011-09-03 Thread priya ramesh
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 thi

Re: [algogeeks] c problem

2011-09-03 Thread himanshu kansal
an array is always an *unmodifiable* l-value. On Sat, Sep 3, 2011 at 6:23 PM, priya ramesh 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. >

[algogeeks] printf

2011-09-03 Thread priya ramesh
what does printf return?? -- 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

Re: [algogeeks] c problem

2011-09-03 Thread priya ramesh
ok but y does the compiler say lvalue required if you perform 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+unsu

Re: [algogeeks] c question

2011-09-03 Thread himanshu kansal
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 wrote: > foo(char []s){ > printf("%d", sizeof(s)); > } > > eve

Re: [algogeeks] printf

2011-09-03 Thread Nikhil Gupta
The number of characters printed. On Sat, Sep 3, 2011 at 6:45 PM, priya ramesh wrote: > what does printf return?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To

Re: [algogeeks] c question

2011-09-03 Thread UTKARSH SRIVASTAV
char *p,char [] are both same they both have size 4 On Sat, Sep 3, 2011 at 6:18 AM, himanshu kansal wrote: > 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 boo

[algogeeks] character count in array

2011-09-03 Thread Aman Kumar
Hiii if array is given like this arr[]=aabcabbcdeadef convert this array into like arr[]=a4b3c2d2e2f1 how can we do this can we do it with space complexity O(1). reply asap -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this

Re: [algogeeks] arrays in c

2011-09-03 Thread UTKARSH SRIVASTAV
an array variable is an *unmodified* lvalue variable -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscr

Re: [algogeeks] c question

2011-09-03 Thread rajul jain
As declaration of a[100] is defined in main function so main function print 100 , but foo() only know a pointer to a char data type that is why it print 4 in function foo() correct me if i am wrong! On Sat, Sep 3, 2011 at 6:52 PM, UTKARSH SRIVASTAV wrote: > char *p,char [] are both same they b

Re: [algogeeks] printf

2011-09-03 Thread priya ramesh
ok thank q :) On Sat, Sep 3, 2011 at 6:51 PM, Nikhil Gupta wrote: > The number of characters printed. > > On Sat, Sep 3, 2011 at 6:45 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> what does printf return?? >> >> -- >> You received this message because you are subscribed to the

Re: [algogeeks] character count in array

2011-09-03 Thread rajul jain
use hashing but you dont get space O(1) in hashing On Sat, Sep 3, 2011 at 6:54 PM, Aman Kumar wrote: > Hiii > if array is given like this > > arr[]=aabcabbcdeadef > > convert this array into like > > arr[]=a4b3c2d2e2f1 > > how can we do this > > can we do it with space complexity O(1). > > reply

Re: [algogeeks] c question

2011-09-03 Thread Anup Ghatage
See, a is defined in main() therefore its scope is limited to main(). It is stored probably in main()'s stack When you pass it to a function as a pointer. You don't make a copy of 'a' onto the function's stack. The only way you can view, manipulate it is using a pointer, and that pointer is your on

Re: [algogeeks] arrays in c

2011-09-03 Thread Anup Ghatage
In other words, The original array identifer, and hence the pointer, is a constant 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

Re: [algogeeks] c question

2011-09-03 Thread priya ramesh
ok i got this point. Plz answer this, s is a 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?? -- You received this message because you are subscribed to the Google Groups "Algor

Re: [algogeeks] character count in array

2011-09-03 Thread priya ramesh
use hashing -- 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 g

Re: [algogeeks] c question

2011-09-03 Thread Anup Ghatage
Isn't it obvious now? -- 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, vi

Re: [algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread siddharam suresh
it can done in with 2 stack(size/length of the each stack is hieght of the tree),(stack1,stack2) num_stack1=find the first element using in order (pushing the ancestor of the first element) in first stack. num_stack2=find the second element using in order (pushing the ancestor of the second eleme

Re: [algogeeks] Book Request <>

2011-09-03 Thread Anup Ghatage
^ +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

Re: [algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread siddharam suresh
it can done in with 2 stack(size/length of the each stack is hieght of the tree),(stack1,stack2) //find the first element using in order { stack1[num_stack1++]=(pushing the ancestor of the first element) in first stack. } //find the second element using in order stack2[num_stack2++]= (pushing the

Re: [algogeeks] arrays in c

2011-09-03 Thread teja bala
arr means the base address of the entire character array if u increase it i.e arr++ array reference that means arr no longer referring to the respective character array, it 'll be lost that's y C won't allow to modify the arr's address. -- You received this message because you are subscribed to t

Re: [algogeeks] character count in array

2011-09-03 Thread Piyush Grover
use hashing u'll get O(1) space.. @rahul...why not?? On Sat, Sep 3, 2011 at 7:13 PM, priya ramesh wrote: > use hashing > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com.

Re: [algogeeks] character count in array

2011-09-03 Thread teja bala
this 'll work if u i/p the string in dis manner aaabbcc(consecutive same) a3b2c2 #include #include main() { int x=1,i=0; char a[100]; gets(a); while(a[i]!='\0') { while(a[i]==a[i+1]) { x++; i++; } printf("%c%d",a[i],x); x=1; i++; } getchar(); } -- You received this message because

Re: [algogeeks] arrays in c

2011-09-03 Thread siddharam suresh
you cant predect the o/p because u are assigning the memory address(16/32 bit) to the charecter variable(8bit). Thank you, Sid. On Sat, Sep 3, 2011 at 7:36 PM, teja bala wrote: > arr means the base address of the entire character array if u increase it > i.e arr++ array reference that means a

[algogeeks] Re: character count in array

2011-09-03 Thread Ankuj Gupta
If we take our input to be characters a-z ans A-Z then we require fixed space which can be treated as O(1). On Sep 3, 7:10 pm, teja bala wrote: > this 'll work if u i/p the string in dis manner > aaabbcc(consecutive same) > a3b2c2 > > #include > #include > main() > { > int x=1,i=0; > char a[100];

Re: [algogeeks] Re: character count in array

2011-09-03 Thread siddharam suresh
sol already posted please search old thread Thank you, Sid. On Sat, Sep 3, 2011 at 8:01 PM, Ankuj Gupta wrote: > If we take our input to be characters a-z ans A-Z then we require > fixed space which can be treated as O(1). > On Sep 3, 7:10 pm, teja bala wrote: > > this 'll work if u i/p the s

[algogeeks] Re: c problem

2011-09-03 Thread Ankuj Gupta
because your are trying to edit an unmodifiable object which C- compiler will not allow On Sep 3, 6:18 pm, priya ramesh wrote: > ok but y does the compiler say lvalue required if you perform a++?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" gr

Re: [algogeeks] Re: character count in array

2011-09-03 Thread rajul jain
@ankuj just want to clarify that in hashing method we require array of fixed size let say arr[26] , so is it considered as constant space or not? On Sat, Sep 3, 2011 at 8:02 PM, siddharam suresh wrote: > sol already posted please search old thread > Thank you, > Sid. > > > > On Sat, Sep 3, 2011

Re: [algogeeks] arrays in c

2011-09-03 Thread Siddhartha Banerjee
how does compiler internally store the fact that a points to an unmodifiable lvalue, and also it's size??? where are the normal pointer variables stored??? (stack region, heap region, data segment???) and the array pointer variable and it's range??? -- You received this message because you are su

[algogeeks] Re: character count in array

2011-09-03 Thread Ankuj Gupta
if for all inputs you array remains of same size we can take it as constant space On Sep 3, 7:49 pm, rajul jain wrote: > @ankuj  just want to clarify that in hashing method we require array of > fixed size let say arr[26] , so is it considered as constant space or not? > > On Sat, Sep 3, 2011 at

[algogeeks] MICROSOFT

2011-09-03 Thread teja bala
SORT ARRAY ON BASIS OF OCCURENCE OF NUMBER {3,3,2,5,5,,5} OUTPUT SHOULD BE LIKE THIS {5,5,5,3,3,2} PLEASE HELP ME WITH CODING PART -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegro

Re: [algogeeks] arrays in c

2011-09-03 Thread siddharam suresh
@Siddhartha: as per my knowledge, strings are stored in code segment(its read only place) please correct me if i m wrong. normal variable/pointer variable stored in stack. i dont know about array. Thank you, Sid. On Sat, Sep 3, 2011 at 8:30 PM, Siddhartha Banerjee wrote: > how does compiler in

Re: [algogeeks] Re: Need algorithm asap

2011-09-03 Thread Siddhartha Banerjee
please check out the code, doesnt give right solution on running... or perhaps i missed something... how should you call your function? if array is a={1,2,3} you call from main function as bipartition(a,0,2), right??? -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Book Request <>

2011-09-03 Thread rahul sharma
ossam bookkplz nyone post the link... On Sat, Sep 3, 2011 at 7:27 PM, Anup Ghatage wrote: > ^ +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 unsubscr

[algogeeks] Re: memory allocation question

2011-09-03 Thread Ankuj Gupta
p is a pointer to an array of 4 integers. So when you do (int(*) [col])malloc(row*sizeof(*p)) total of 48 bytes is allocated as sizeof(*p) is 12 bytes. On Sep 3, 4:14 pm, rohit wrote: > how many bytes are allocated by following code? > > #include > #define col 4 > #define row 3 > > int main() > {

[algogeeks] Re: Find Max Sum Value Pairs

2011-09-03 Thread Dave
@Piyush: Try your code with n = 10 a[10] = {11,22,33,44,55,66,77,88,99,110} b[10] = {10,20,30,40,50,60,70,80,90,100} Your code gets (110, 100) = 210 (110, 90) = 200 (99, 100) = 199 (110, 80) = 190 (88, 100) = 188 (110, 70) = 180 (77, 100) = 177 (110, 60) = 170 (66, 100) = 166 (110, 50) = 160 bu

[algogeeks] Suffix tree

2011-09-03 Thread teja bala
Any one plzz post the material for suffix tree or elaborate suffix tree entirely.. -- 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 e

Re: [algogeeks] Re: memory allocation question

2011-09-03 Thread Deepak Garg
+1 On Sat, Sep 3, 2011 at 8:57 PM, Ankuj Gupta wrote: > p is a pointer to an array of 4 integers. So when you do (int(*) > [col])malloc(row*sizeof(*p)) total of 48 bytes is allocated as > sizeof(*p) is 12 bytes. > > On Sep 3, 4:14 pm, rohit wrote: > > how many bytes are allocated by following c

[algogeeks] Algorithms for Interviews

2011-09-03 Thread Ankuj Gupta
If someone has Algorithms for Interviews please share with me. I tried the link which was earlier posted on the group but it says it is locked. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@goo

[algogeeks] Re: character count in array

2011-09-03 Thread icy`
Just use a hash to count frequency of something; e.g. in ruby: ar= %w(a a b c a b b c d e a d e f) freq=Hash.new(0) ar.each {|c| freq[c]+=1} p freq #output #{"a"=>4, "b"=>3, "c"=>2, "d"=>2, "e"=>2, "f"=>1} you could only do it in place in O(1) only if your input array is already 2*(number of al

Re: [algogeeks] Algorithms for Interviews

2011-09-03 Thread vivek goel
hey u frm which college. On Sat, Sep 3, 2011 at 9:04 PM, Ankuj Gupta wrote: > If someone has Algorithms for Interviews please share with me. I tried > the link which was earlier posted on the group but it says it is > locked. > > -- > You received th

Re: [algogeeks] Re: memory allocation question

2011-09-03 Thread piyush agarwal
no. of rows is 3 size of (*p) is 12 then how can 48 be the no. of bytes ?? On Sat, Sep 3, 2011 at 8:32 AM, Deepak Garg wrote: > +1 > > > On Sat, Sep 3, 2011 at 8:57 PM, Ankuj Gupta wrote: > >> p is a pointer to an array of 4 integers. So when you do (int(*) >> [col])malloc(row*sizeof(*p)) total

[algogeeks] Re: Network Question

2011-09-03 Thread VIHARRI
I think the communication problem is just bcoz of longest prefix match... On Sep 3, 10:09 am, Vengadanathan wrote: > ya both the subnet can exisit in the same network , but problem is > lack of communication between the two subnets ,because in routing > table of the router the record for  10.0.1.

Re: [algogeeks] Algorithms for Interviews

2011-09-03 Thread Nitin Garg
Even i need the book. Please reshare a working link. I am studying computer science at IIT Delhi. On Sat, Sep 3, 2011 at 9:08 PM, vivek goel wrote: > hey u frm which college. > > On Sat, Sep 3, 2011 at 9:04 PM, Ankuj Gupta wrote: > >> If someone has

Re: [algogeeks] Re: Find Max Sum Value Pairs

2011-09-03 Thread Piyush Grover
@Dave..:-O well catch... On Sat, Sep 3, 2011 at 9:00 PM, Dave wrote: > @Piyush: Try your code with > > n = 10 > a[10] = {11,22,33,44,55,66,77,88,99,110} > b[10] = {10,20,30,40,50,60,70,80,90,100} > > Your code gets > > (110, 100) = 210 > (110, 90) = 200 > (99, 100) = 199 > (110, 80) = 190 > (88

Re: [algogeeks] Algorithms for Interviews

2011-09-03 Thread Nitin Garg
This link worked for me http://www.mediafire.com/?a2ia1j1i0q0pet1 On Sat, Sep 3, 2011 at 9:22 PM, Nitin Garg wrote: > Even i need the book. > Please reshare a working link. > > I am studying computer science at IIT Delhi. > > > On Sat, Sep 3, 2011 at 9:08 PM, vivek goel wrote: > >> hey u frm

Re: [algogeeks] arrays in c

2011-09-03 Thread sukran dhawan
array shud be char * nt just char.here ur declaring a char variable yes array is a const pointer On Sat, Sep 3, 2011 at 6:25 PM, priya ramesh wrote: > main(){ > char arr="algogeeks\0"; > arr++; > } > > y does the compiler complain l value required in line 3.?? > arr is a pointer holding address.

Re: [algogeeks] MICROSOFT

2011-09-03 Thread Anup Ghatage
Sort the given array first. : O(n logn) You'll have: {2,3,3,5,5,5} First parse all the elements in the array and identify the unique ones and store the count in N Now create a two dimensional array A[N][2]; Store the number in A[0][0] and store its frequency in A[0][1] etc. : O (n) Now, reverse

Re: [algogeeks] Re: Network Question

2011-09-03 Thread sukran dhawan
ya the longest mask matching will take place On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI wrote: > I think the communication problem is just bcoz of longest prefix > match... > > On Sep 3, 10:09 am, Vengadanathan wrote: > > ya both the subnet can exisit in the same network , but problem is > > lack

Re: [algogeeks] Re: memory allocation question

2011-09-03 Thread Nitin Garg
int(*p)[col]; Here, p is a pointer to an array of 4 integers. Size of *p is 4X4 = 16. p=(int(*)[col])malloc(row*sizeof(*p)); here clearly 3X 16 = 48 bytes of memory is being allocated. On Sat, Sep 3, 2011 at 9:14 PM, piyush agarwal wrote: > no. of rows is 3 > size of (*p) is 12 > then how

Re: [algogeeks] c problem

2011-09-03 Thread sukran dhawan
lvalue On Sat, Sep 3, 2011 at 6:44 PM, himanshu kansal wrote: > 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?? >>

Re: [algogeeks] c problem

2011-09-03 Thread sukran dhawan
@priya :array is a constant pointer to a non constant data remember On Sat, Sep 3, 2011 at 6:48 PM, priya ramesh wrote: > ok but y does the compiler say lvalue required if you perform a++?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gr

[algogeeks] Padding....

2011-09-03 Thread Debabrata Das
how output is 12 on typical 32 bit system and why? #include struct x { int y; char x; float z; }; main() { printf("%d",sizeof(struct x)); } what is the rule of padding -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this grou

[algogeeks] Request for crack coding book ebook

2011-09-03 Thread UMESH KUMAR
hi anybody do you have CrackCoding ebook pls send . thanks -- 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...@

Re: [algogeeks] c question

2011-09-03 Thread sukran dhawan
when u pass array as an argument to a function only the starting address is passed .so sizeof(a) is address of pointer ! On Sat, Sep 3, 2011 at 6:22 PM, priya ramesh wrote: > In any C program, > int main(){ > char a[100]; > foo(a); > printf("%d", sizeof(a)); > } > foo(char *s){ > printf("%d", si

Re: [algogeeks] Padding....

2011-09-03 Thread siddharam suresh
each object in the structure will take one memory word.(if one object then its size of that object) Thank you, Sid. On Sat, Sep 3, 2011 at 10:27 PM, Debabrata Das < debabrata.barunhal...@gmail.com> wrote: > how output is 12 on typical 32 bit system and why? > #include > struct x > { > int y; >

[algogeeks] Re: Suffix tree

2011-09-03 Thread Navneet
http://marknelson.us/1996/08/01/suffix-trees/ On Sep 3, 8:30 pm, teja bala wrote: > Any one plzz post the material for suffix tree or elaborate suffix > tree entirely.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this

[algogeeks] C puzzle

2011-09-03 Thread teja bala
Find the output of the following code - plzzz xplain the o/p int find(int j) { if(j>1) { j=find(j/10)-(j%10); printf("%d",j); } else { j=0; } return j; } int main() { int i=19222; int k; k=find(i); } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" g

[algogeeks] need explanation of this c code

2011-09-03 Thread sinjanspecial
code:- void main() { int i=5; i=(++i)/(i++); printf("%d",i) } Output is 2 plz explain how it is? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group,

Re: [algogeeks] need explanation of this c code

2011-09-03 Thread vivek goel
firstly ++i will be evaluatedso i=6 then expression will be i=6/6; so now i will be equal to 1.. after the expression will be evaluated i++ post increment will work since, post increment works only if a semi-colon occurs or comma operator occurs. so now i will increment aft

Re: [algogeeks] c problem

2011-09-03 Thread priya ramesh
if it is an l value, the compiler should say "cannot modify const value" instead it says "l value required" This statement proves that a is an r value in main. right?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, sen

Re: [algogeeks] MICROSOFT

2011-09-03 Thread Siddhartha Banerjee
perhaps we can make it O(mlogm), m= no of distinct elements... just create a hash table and store the count of the number of time elements occur... O(n), now sort the m elements and proceed as above... it is obviously not possible to do it faster than O(mlogm), where m = no of distinct elements...

Re: [algogeeks] Padding....

2011-09-03 Thread rahul sharma
ans is: 16 i thninkj... float take 8 bytes so pdding is :- int take 4 bytes 1 char 3 bytes pad + 8 byte float=16 On Sat, Sep 3, 2011 at 10:30 PM, siddharam suresh wrote: > each object in the structure will take one memory word.(if one object then > its size of that object) > Thank you, > S

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
create a binary search tree by scanning the whole array and if the value already exists increase count field in that node O(nlogn). Now traverse the tree in any order by creating another tree with kery - count. O(nlogn). Doing reverse inorder traversal print value field of each node count number of

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
Ohh my bad. the complexity should be O(nlogn) + O(mlogm) +O(m) = O(tlogt) where t=max(m,n) On Sat, Sep 3, 2011 at 11:46 PM, mohit verma wrote: > create a binary search tree by scanning the whole array and if the value > already exists increase count field in that node O(nlogn). Now traverse the

Re: [algogeeks] Re: Network Question

2011-09-03 Thread sagar pareek
ok i know it will match longest mask...but then it will always skip the ip of shorter mast if it has same ip address On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan wrote: > ya the longest mask matching will take place > > > On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI wrote: > >> I think the communic

Re: [algogeeks] Re: Network Question

2011-09-03 Thread sagar pareek
mask* On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek wrote: > ok i know it will match longest mask...but then it will always skip the ip > of shorter mast if it has same ip address > > > On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan wrote: > >> ya the longest mask matching will take place >> >>

Re: [algogeeks] MICROSOFT

2011-09-03 Thread Dheeraj Sharma
count sort in reverse order would help i guess :) On Sat, Sep 3, 2011 at 11:49 PM, mohit verma wrote: > Ohh my bad. the complexity should be > O(nlogn) + O(mlogm) +O(m) = O(tlogt) where t=max(m,n) > > > On Sat, Sep 3, 2011 at 11:46 PM, mohit verma wrote: > >> create a binary search tree by scann

[algogeeks] explain the putput of this program

2011-09-03 Thread Ankit Sablok
#include #include #include #include #include using namespace std; int main() { int **h; int a[2][2]={1,2,3,4}; h= (int **)a; int i,j; printf("\n%d",*h); (*h)++; printf("\n%d",*h); getchar(); getchar(); return 0; } gives an output 1 and 5 why? -- You received this message be

[algogeeks] whats d problem wid using gets?

2011-09-03 Thread Shashank Jain
Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- 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 algogee

Re: [algogeeks] MICROSOFT

2011-09-03 Thread mohit verma
@dheeraj - for count sort we need to know the range the numbers are in. Otherwise how will u initialize array keeping count? On Sun, Sep 4, 2011 at 12:03 AM, Dheeraj Sharma wrote: > count sort in reverse order would help i guess :) > > > On Sat, Sep 3, 2011 at 11:49 PM, mohit verma wrote: > >> O

Re: [algogeeks] Pattern Matching

2011-09-03 Thread Dheeraj Sharma
for * it can be like.. for example we have any string say *ab*c*de* it is composed of three strings ..that has to be searched.in that sequece in only..which means..first ab would appear..then c ..then de.. first search for pattern "ab" in string..using pattern matching function.. then search for c

Re: [algogeeks] Pattern Matching

2011-09-03 Thread Dheeraj Sharma
for '?' u just increment ur pointer(which is returned by previous one.) by 1.. On Sun, Sep 4, 2011 at 12:09 AM, Dheeraj Sharma wrote: > for * it can be like.. for example we have any string say *ab*c*de* > it is composed of three strings ..that has to be searched.in that sequece > in only..whic

[algogeeks] Round robin schedulling

2011-09-03 Thread Abhay Prakash
http://www.spoj.pl/problems/RRSCHED/ getting tle in this.. did without linked list also (and using linked list also - deleting the nodes which are not further required) -- Abhay Prakash -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. T

Re: [algogeeks] whats d problem wid using gets?

2011-09-03 Thread sukran dhawan
+1 On Sun, Sep 4, 2011 at 12:07 AM, Shashank Jain wrote: > > Shashank Jain > IIIrd year > Computer Engineering > Delhi College of Engineering > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algo

Re: [algogeeks] need explanation of this c code

2011-09-03 Thread sukran dhawan
its compiler dependent On Sat, Sep 3, 2011 at 10:59 PM, sinjanspecial wrote: > code:- > void main() > { > int i=5; > i=(++i)/(i++); > printf("%d",i) > } > Output is 2 > plz explain how it is? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gr

Re: [algogeeks] Hash Table

2011-09-03 Thread sukran dhawan
good material On Sat, Sep 3, 2011 at 1:59 PM, payal gupta wrote: > this might be hlpful... > Regards, > PAYAL GUPTA > > > On Sat, Sep 3, 2011 at 10:44 AM, Rahul Verma wrote: > >> I am facing some difficulty in the implementation of Hash Table. Anyone >> can please share the good resources for Ha

Re: [algogeeks] MICROSOFT

2011-09-03 Thread Dheeraj Sharma
yeah..we it works for +ve number..within some specified range..it was alternate to O(nlogn) solution..if range is known On Sun, Sep 4, 2011 at 12:07 AM, mohit verma wrote: > @dheeraj - for count sort we need to know the range the numbers are in. > Otherwise how will u initialize array keeping c

Re: [algogeeks] whats d problem wid using gets?

2011-09-03 Thread harshit sethi
gets() is normally used to input string consisting of multiple words. This is not possible using single scanf() On 9/4/11, sukran dhawan wrote: > +1 > > On Sun, Sep 4, 2011 at 12:07 AM, Shashank Jain wrote: > >> >> Shashank Jain >> IIIrd year >> Computer Engineering >> Delhi College of Enginee

[algogeeks] Info about Epic Written Exam

2011-09-03 Thread Harshit Sethi
hi,can anyone tell me what's the procedure of recruiting in EPIC. what's the format of written test.Which are the different sections in the exam ? Also,whether it is a good place to work or not? Thanks in advance !!! -- You received this message because you are subscribed to the Google Groups

  1   2   >