Re: [algogeeks] Difference between memcpy and memmove

2012-08-06 Thread Kazal Sharma
memcpy() just copies from source to destination.It copies the bytes of data between memory blocks. If the block of memory overlaps, the function might not work properly. memmove() is just like memcopy() but it deals with handling of overlapping of memory blocks. kazal HPU On 8/6/12, Vipin wrot

[algogeeks] Difference between memcpy and memmove

2012-08-06 Thread Vipin
As far as I could understand, memcpy just iterate through the memory( byte by byte or word by word) and blindly copies 'n' number of bytes from source to destination without considering whether source and destination memory overlaps. While memmove first copies n number of bytes to intermediate

Re: [algogeeks] difference b/w static global variables and global variables

2012-02-25 Thread atul anand
@abv : question sayss.. (apart from that static variables will be limited to that file only and global variables will be visible for other files also.) On Sat, Feb 25, 2012 at 10:44 PM, rajat ahuja wrote: > Scope might be diferent if u define static in function . it will be > intilaized once when

Re: [algogeeks] difference b/w static global variables and global variables

2012-02-25 Thread rajat ahuja
Scope might be diferent if u define static in function . it will be intilaized once when u call it first time but scope of that variable will be limited to that function only but they live throught out the programe though scope is limited in case of global it can be used in ny function On Sat, Feb

Re: [algogeeks] difference b/w static global variables and global variables

2012-02-25 Thread Akanksha .
Global variable are accessible from other file as well but static global variables are only accessible in that particular file. On Sat, Feb 25, 2012 at 10:21 PM, AMAN AGARWAL wrote: > Hi , > > Is there any difference b/w static global variables and global variables > ??? > > (apart from that st

[algogeeks] difference b/w static global variables and global variables

2012-02-25 Thread AMAN AGARWAL
Hi , Is there any difference b/w static global variables and global variables ??? (apart from that static variables will be limited to that file only and global variables will be visible for other files also.) Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is t

Re: [algogeeks] difference btw int *a[] and int (*a)[]

2011-11-14 Thread DIPANKAR DUTTA
Hey..there are a simple way to convert this type of expression into English. int *a[] : 'a' is an array of pointer to integer.. i.e : integer-pointer array int (*a)[] : 'a' is a pointer to a array that contains integers : ie pointer to an integer array.. see below how it derived..: int

Re: [algogeeks] difference btw int *a[] and int (*a)[]

2011-11-13 Thread sumit mahamuni
@anup: Dude u missed the second its int (*a)[] not pointer to function its the pointer to integer array On Mon, Nov 14, 2011 at 7:00 AM, Anup Ghatage wrote: > First is an array of pointers to integers. > Second is a pointer to a function that returns an integer. > > On Mon, Nov 14, 2011 at 12:11

Re: [algogeeks] difference btw int *a[] and int (*a)[]

2011-11-13 Thread sumit mahamuni
hi, one is the array of integer pointers and the other is pointer to integer array. On Mon, Nov 14, 2011 at 12:11 AM, rj7 wrote: > Could someone pls tell me the difference between int *a[] and int (*a) > [] > > -- > You received this message because you are subscribed to the Google Groups >

Re: [algogeeks] difference btw int *a[] and int (*a)[]

2011-11-13 Thread Anup Ghatage
First is an array of pointers to integers. Second is a pointer to a function that returns an integer. On Mon, Nov 14, 2011 at 12:11 AM, rj7 wrote: > Could someone pls tell me the difference between int *a[] and int (*a) > [] > > -- > You received this message because you are subscribed to the G

[algogeeks] difference btw int *a[] and int (*a)[]

2011-11-13 Thread rj7
Could someone pls tell me the difference between int *a[] and int (*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 algogee

Re: [algogeeks] difference ?

2011-09-09 Thread sumit kumar pathak
*int var without initialization gives junk values to var * *Doing its '&' with 0 will give 0. * *In other case you are normally assigning it some value.* regards - Sumit Kumar Pathak (Sumit/ Pathak/ SKP ...) *Smile is only good contagious thing.* *Spread it*! On Fri, Sep 9, 2011 at 4:31 PM,

[algogeeks] difference ?

2011-09-09 Thread siddharam suresh
is there any difference b/w int var; var=0; and int var; var & =0; both codes yield the same value right? Thank you, Sid. -- 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] difference between the two

2011-08-07 Thread Puneet Gautam
How do u define size of compiler...? On 8/6/11, SANDEEP CHUGH wrote: > @ sid : can u please elaborate considering these parameters > > 1 size of compiler > 2 size of os and > 3 size of processor > > please explain for any case, considering these three parameters and tell me > how these parameter

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
@ sid : can u please elaborate considering these parameters 1 size of compiler 2 size of os and 3 size of processor please explain for any case, considering these three parameters and tell me how these parameters do affect.. ty On Sat, Aug 6, 2011 at 9:53 PM, siddharth srivastava wrote: > > >

Re: [algogeeks] difference between the two

2011-08-06 Thread siddharth srivastava
On 6 August 2011 21:50, siddharth srivastava wrote: > Hi > > On 6 August 2011 20:20, SANDEEP CHUGH wrote: > >> padding wud be between int & char..(for ur last case) >> >> now u said if it starts at 4 , still the block will be 8 (size of double), >> that is 7 bytes to be padded.. >> >> so double

Re: [algogeeks] difference between the two

2011-08-06 Thread siddharth srivastava
Hi On 6 August 2011 20:20, SANDEEP CHUGH wrote: > padding wud be between int & char..(for ur last case) > > now u said if it starts at 4 , still the block will be 8 (size of double), > that is 7 bytes to be padded.. > > so double element of structure would be starting at 4 + char(1) + 7 byte > p

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
padding wud be between int & char..(for ur last case) now u said if it starts at 4 , still the block will be 8 (size of double), that is 7 bytes to be padded.. so double element of structure would be starting at 4 + char(1) + 7 byte padding ==12 but 12 is not a multiple of 8.. so there is a pr

Re: [algogeeks] difference between the two

2011-08-06 Thread siddharth srivastava
> > but if the reference is not 0 .. if it wud have been 4 then for tht case > tell me do we really need that 7 bytes?? > yes, because in any case the block would be of 8 bytes only so even if you start at 4, you would have only 7 bytes left in that location for the next variable(which in this ca

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
@sid : yeah agree to ur explanation.. but if the reference is not 0 .. if it wud have been 4 then for tht case tell me do we really need that 7 bytes?? and yeah it is dependent on compiler size.. if u compile this snippet struct demo { char c; double d; int s; > }

Re: [algogeeks] difference between the two

2011-08-06 Thread siddharth srivastava
Hi Sandeep On 6 August 2011 19:16, SANDEEP CHUGH wrote: > take this case > > struct demo > { >char c; >double d; >int s; > >> } > > > what wud be the size?? > > > solution is 24 according to following:--> > > char (1) + 7 byte padding +double(8)+int(4)+ 4 byte padd

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
take this case struct demo { char c; double d; int s; > } what wud be the size?? solution is 24 according to following:--> char (1) + 7 byte padding +double(8)+int(4)+ 4 byte padding suppose address starts at 4.. i just wanna ask .. why there is 7 byte padding.

Re: [algogeeks] difference between the two

2011-08-06 Thread Puneet Gautam
Well, even in dat case no difference occurs As far as i know, because we cant predict where its address is going to start from, in real time i.e. in memory, it will always give u the same size as output..if u run the code.. So the whole point is that the size comes down to the highest sized va

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
@ puneet : tell me the case if u take the address to be starting from 4 not 0.. On Sat, Aug 6, 2011 at 6:55 PM, SANDEEP CHUGH wrote: > @ puneet : ryt !! gud explanation. > > > On Sat, Aug 6, 2011 at 6:53 PM, Puneet Gautam wrote: > >> Order is important ... but in the main case here which is >>

Re: [algogeeks] difference between the two

2011-08-06 Thread SANDEEP CHUGH
@ puneet : ryt !! gud explanation. On Sat, Aug 6, 2011 at 6:53 PM, Puneet Gautam wrote: > Order is important ... but in the main case here which is > > 1) struct list >{ > int data; > list *next; > } > and > 2) struct list >{ > list *next; > int data; > } >

Re: [algogeeks] difference between the two

2011-08-06 Thread Puneet Gautam
Order is important ... but in the main case here which is 1) struct list { int data; list *next; } and 2) struct list { list *next; int data; } order is not affecting its size...!! On 8/6/11, Puneet Gautam wrote: > See guys.. the order is important but

Re: [algogeeks] difference between the two

2011-08-06 Thread Puneet Gautam
See guys.. the order is important but the size of whole structure needs to be a multiple of its largest sized variable... eg: struct p { double data; char a; char b; char c; char d; }t; struct q {char c; char d; double data;

Re: [algogeeks] difference between the two

2011-08-06 Thread Nitish Garg
I think that the order is important. Because when we consider an array of structures the order becomes extremely important just as shown in the above example. On Sat, Aug 6, 2011 at 6:18 PM, Prashant Gupta wrote: > Interesting : > #include > using namespace std; > int main() > { > struct p{ >

Re: [algogeeks] difference between the two

2011-08-06 Thread Prashant Gupta
Interesting : #include using namespace std; int main() { struct p{ int i; char j; char k; }; struct q{ char j; int i; char k; }; printf("p=%u q=%u",sizeof(p),sizeof(q)); return 0; } o/p : p=8 q=12 On Sat, Aug 6, 2011 at 2:55 P

[algogeeks] difference b/w static variable,malloc variable and global variable

2011-08-06 Thread siddharam suresh
please tell what are the difference(scope) b/w static variable, variable defined by malloc and global variable. Thank you, Siddharam On Sat, Aug 6, 2011 at 3:52 PM, siddharam suresh wrote: > take the median of both the array MX, MY. (MX+1 means next element to MX in > array X. lly to MY+1) > re

Re: [algogeeks] difference between the two

2011-08-06 Thread Tushar Bindal
that means the order is immaterial. the sizeof the struct always remains same irrespective of the order and just depends on the type of variables??? why char with double does not get size in multiples of 8?? On Sat, Aug 6, 2011 at 12:54 PM, Puneet Gautam wrote: > Sorry guys, int is 4 bytes on 64

Re: [algogeeks] difference between the two

2011-08-06 Thread Puneet Gautam
Sorry guys, int is 4 bytes on 64 bit and 2 bytes on 32 bit system.. But padding rule remains same for both structures as mentioned above... On 8/6/11, Puneet Gautam wrote: > There is no difference between the two... > > On 32 bit system, both structures need every address location where > int

Re: [algogeeks] difference between the two

2011-08-06 Thread Puneet Gautam
There is no difference between the two... On 32 bit system, both structures need every address location where int and pointer are stored to be a multiple of 4(highest size is 4).. On 64 bit, even if pointer is 4bytes(say, in 64 bit system), and p1, p2 be structure variables, then p2 should start

Re: [algogeeks] difference between the two

2011-08-05 Thread Tushar Bindal
http://www.serc.iisc.ernet.in/ComputingFacilities/systems/cluster/xlf/html/xlfug/ug35.htm this says int is always 4 bytes and pointer is 8 bytes on 64 bit compiler. so how does padding affect these structures because of the difference in size of int and pointer? I tried this program https://ideo

Re: [algogeeks] difference between the two

2011-08-05 Thread Shashank Jain
i dont understand the diff btw dem, could u plz elaborate? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Sat, Aug 6, 2011 at 12:32 AM, Kamakshii Aggarwal wrote: > in case of 64 bit, > size of second structure will also be 16 not 8 > > > On Fri, Aug 5, 2011 at 11

Re: [algogeeks] difference between the two

2011-08-05 Thread Kamakshii Aggarwal
in case of 64 bit, size of second structure will also be 16 not 8 On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV wrote: > I think voth are just same.. > > > On Fri, Aug 5, 2011 at 10:57 AM, priya v wrote: > >> in case of 64 bit machine y doesn't padding happen in the 2nd stru

Re: [algogeeks] difference between the two

2011-08-05 Thread UTKARSH SRIVASTAV
I think voth are just same.. On Fri, Aug 5, 2011 at 10:57 AM, priya v wrote: > in case of 64 bit machine y doesn't padding happen in the 2nd structure? > > > On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote: > >> no ,if u r using 32 bit machine . that will use 4 byte pointer si

Re: [algogeeks] difference between the two

2011-08-05 Thread priya v
in case of 64 bit machine y doesn't padding happen in the 2nd structure? On Fri, Aug 5, 2011 at 11:21 PM, hary rathor wrote: > no ,if u r using 32 bit machine . that will use 4 byte pointer size , > but in 64 machine that enforce to be size of 8 . where padding will take > int your given first

Re: [algogeeks] difference between the two

2011-08-05 Thread hary rathor
no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in on

[algogeeks] difference between the two

2011-08-05 Thread priya v
Whats the difference between the two ? 1) struct list { int data; list *next; } and 2) struct list { list *next; int data; } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, sen

Re: [algogeeks] Difference btwn elements in a sorted array a-b=k

2011-06-07 Thread Piyush Sinha
Whats the problem in using two pointers one pointing the lower index while the other pointing the upper index?? On Tue, Jun 7, 2011 at 2:57 PM, ross wrote: > Given an integer 'k' and an sorted array A (can consist of both +ve/- > ve nos), > output 2 integers from A such that a-b=k. > PS: > nlo

[algogeeks] Difference btwn elements in a sorted array a-b=k

2011-06-07 Thread ross
Given an integer 'k' and an sorted array A (can consist of both +ve/- ve nos), output 2 integers from A such that a-b=k. PS: nlogn solution would be to check for the occurence of k-a[i] (using bin search) when you encounter a[i]. methods like hash consume space. Is an O(n) solution with O(1) extra

Re: [algogeeks] difference x

2010-12-22 Thread VIVEK RAMAMURTHY
for each element i,implement binary search to find the position of i+x.. this will take o(n log n) correct me if i m wrong On Wed, Dec 22, 2010 at 3:35 PM, snehal jain wrote: > How will you find the pair from an sorted array whose difference is x > > -- > You received this message because yo

[algogeeks] difference x

2010-12-22 Thread snehal jain
How will you find the pair from an sorted array whose difference is x -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+un

[algogeeks] Difference between Singleton pattern and static member

2010-12-15 Thread Prims
there is at all any difference between a Singleton class and one with all static member (ie methods and attributes ) We could not find any instance where 'all static member class' would not achieve the same functionality as class properely implementing Singleton pattern ?? For eg java.lang.Runtim

Re: [algogeeks] Difference b/w two elements in a array

2010-07-11 Thread Amit Jaspal
Constraint - O(n) On Sun, Jul 11, 2010 at 9:24 AM, amit wrote: > Given an array of size n.find 2 numbers from array whose difference is > least. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to al

Re: [algogeeks] Difference b/w two elements in a array

2010-07-11 Thread jalaj jaiswal
sort the numbers ... the numbers with minimum difference will be adjacent On Sun, Jul 11, 2010 at 9:54 PM, amit wrote: > Given an array of size n.find 2 numbers from array whose difference is > least. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm

Re: [algogeeks] Difference b/w two elements in a array

2010-07-11 Thread Mihai Donțu
On Sunday 11 July 2010 19:24:28 amit wrote: > Given an array of size n.find 2 numbers from array whose difference is > least. Sort the array, then substract the last element from the first. -- Mihai Donțu -- You received this message because you are subscribed to the Google Groups "Algorithm

[algogeeks] Difference b/w two elements in a array

2010-07-11 Thread amit
Given an array of size n.find 2 numbers from array whose difference is least. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algo

Re: [algogeeks] Difference between assignment operator and copy constructor

2010-06-29 Thread Anand
http://www.codeguru.com/cpp/cpp/algorithms/general/article.php/c9585 On Tue, Jun 29, 2010 at 12:32 AM, Raj N wrote: > Hi, > Can anyone tell me the difference between using an assignment operator > and copy constructor ? > > sample s1; > sample s2; > s2=s1; > sample s3(s2); > > -- > You received

[algogeeks] Difference between assignment operator and copy constructor

2010-06-29 Thread Raj N
Hi, Can anyone tell me the difference between using an assignment operator and copy constructor ? sample s1; sample s2; s2=s1; sample s3(s2); -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@goog

Re: [algogeeks] Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

2009-12-14 Thread Linus Probert
There are some time differences and all, the vital part is that bellman-ford handles negative weights on the edges in the graph, Dijkstras does not. Besides that there is some time difference and so forth. Bellman-ford: O(V|E|) Dijkstra: O(v²) ? (give or take depending on the heap or priority qu

Re: [algogeeks] Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

2009-12-14 Thread Piyush Verma
bellman-ford's algo works on graph having -ve edge cycle, but dijkstra algo would not work on that type of graph, it is implemented on the graph of +ve edges. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email t

Re: [algogeeks] Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

2009-12-14 Thread Rohit Saraf
to allow negative weights -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options

Re: [algogeeks] Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

2009-12-14 Thread Rohit Saraf
Algorithm Bellman-Ford is in its basic structure very similar to Dijkstra's algorithm, but instead of greedily selecting the minimum-weight node not yet processed to relax, it simply relaxes *all* the edges, and does this |*V*| - 1 times, where

[algogeeks] Difference between Dijkstra's algorithm and Bellman-Ford's algorithm?

2009-12-14 Thread vicky
What is the difference between Dijkstra's algorithm and Bellman-Ford's algorithm? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Difference between partitionig algorithms in quicksort

2006-08-13 Thread Alireza Ghasemi
Hello,In quicksort,some partitioning algorithms separate the pivot element from the two partitions they form,so that the sort procedure looks like : (i,j : first nd last elements)if (i>j) return;int p=partition(i,j); sort(i,p-1);sort(p+1,j);while the others (like hoare's partitionig) place t

[algogeeks] difference between GUID and UUIID?

2006-06-20 Thread pantagruel
Hi, someone told me recently that the difference between a GUID and UUID was that a GUID could not be proven mathematically to be unique, but a UUID could. I was under the impression that the two were the same. Any insight on this? Thanks. Cheers, Bryan Rasmussen --~--~-~--~~

[algogeeks] difference

2006-03-08 Thread anil kumar N R
hi friends, can any one tell me what's the difference between malloc and calloc? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@