@ Wastrel and Niteesh Mehra:
I tried running the code:
char *str;
strcpy(str, junk);
this gave a segmentation fault on Ubuntu 11.04 gcc-4.5.2 (32 bit OS)
I think we should consider the general concept that a pointer cannot be used
until it is assigned some memory.
--
You received this
How can the element be regained from hash table?
On Sat, Aug 6, 2011 at 2:41 AM, mohit verma mohit89m...@gmail.com wrote:
yes you can... for randomness , the key value will be key=rand() and now
implement your hash function with this key.
On Fri, Aug 5, 2011 at 4:53 PM, Kamakshii Aggarwal
Try a dry run on the following linked list
1-2-3-4-5-6-Null
head is a global variable;
The recursion will take place till 6 and assign head address of 6;
then it will first change 5-6-(back to 5) [root-next-next = root]
when it will be back to 4, change 4-5-(back to 4) . at this stage the
This looks quite simple.
Every number ending in 3 follows a pattern.eg-
3 - 111
13 - 11
23 - 1 etc
we can find the reauired no. by :
suppose input no. is 33
In every case leave the no at 1's place(least significant) i.e. 3, In
33 you will be left with 3(after removal of 3 at first
according to me 2nd structure must also have 16 bit size for 64 bit
architecture as padding must also take place there also.
On Aug 6, 4:10 am, Shashank Jain shashan...@gmail.com wrote:
i dont understand the diff btw dem, could u plz elaborate?
Shashank Jain
IIIrd year
Computer Engineering
yes u r wrong..
1 is nt divisible by 23
On Sat, Aug 6, 2011 at 9:15 AM, sumit sumitispar...@gmail.com wrote:
This looks quite simple.
Every number ending in 3 follows a pattern.eg-
3 - 111
13 - 11
23 - 1 etc
we can find the reauired no. by :
suppose input no. is 33
In
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
Right. But why does my compiler behave weirdly
--
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/-/iWbW5rOYO1EJ.
To post to this group, send email to
At many places, it has been mentioned that in C, a structure (when not
packed) pads its content so as to facilitate memory alignment so that
its members are accessed faster.
like for e.g the snippet
struct node
{
char d;
int a;
};
int main(){
struct node a;
printf(size = %d,sizeof(a));
}
see what piyush posted
On Sat, Aug 6, 2011 at 4:35 AM, Shashank Jain shashan...@gmail.com wrote:
sagar - i dint get u, d code thing!
Shashank Jain
IIIrd year
Computer Engineering
Delhi College of Engineering
On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek sagarpar...@gmail.comwrote:
IEEE notation..
they appear to be the same but they are not same..0.5d has higher
precision that does not necessarily means its larger..
On Sat, Aug 6, 2011 at 10:20 AM, sagar pareek sagarpar...@gmail.com wrote:
see what piyush posted
On Sat, Aug 6, 2011 at 4:35 AM, Shashank
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i j)
swap( i, j );
printf( “%d %d %d”, i, j, temp);
}
On compiling i got ans 10, 0, 0.explain..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
hint:MACRo is just substituted as it is
On Sat, Aug 6, 2011 at 10:23 AM, ranjane ranjane...@gmail.com wrote:
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i j)
swap( i, j );
printf( “%d %d %d”, i, j, temp);
}
On compiling i got ans
Try compiling with gcc -E filename.c.That will clear everything
On Sat, Aug 6, 2011 at 10:25 AM, saurabh singh saurab...@gmail.com wrote:
hint:MACRo is just substituted as it is
On Sat, Aug 6, 2011 at 10:23 AM, ranjane ranjane...@gmail.com wrote:
# define swap(a,b) temp=a; a=b;
@saurabh
what? i didnt get you
On Sat, Aug 6, 2011 at 10:22 AM, saurabh singh saurab...@gmail.com wrote:
IEEE notation..
they appear to be the same but they are not same..0.5d has higher
precision that does not necessarily means its larger..
On Sat, Aug 6, 2011 at 10:20 AM,
@saurabh:ya got it..thanks
On Sat, Aug 6, 2011 at 10:26 AM, saurabh singh saurab...@gmail.com wrote:
Try compiling with gcc -E filename.c.That will clear everything
On Sat, Aug 6, 2011 at 10:25 AM, saurabh singh saurab...@gmail.com wrote:
hint:MACRo is just substituted as it is
On
a double has a higher precision than float i.e. it has larger number of bits
for the mantisa part.
when float is compared to double it is promoted to double by filling
remaining bits in mantissa with 0.
consider this code
http://ideone.com/y1Ahu
http://ideone.com/y1AhuIts equal bcoz the
when swap is called ,as it is a macro ,before compilation its code is
replaced and the code before compilation bcomes:
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i j)
//code replaced here
temp=a; //not executed (false)
a=b;
@hary :
Ur solution is good... But if the problem is modified so that the string
can contain alphanumeric characters is there any better way to do it..
On 5 August 2011 23:11, hary rathor harry.rat...@gmail.com wrote:
i have used 26 bit of checker variable
then i have checked in if statemet
suppose i have 6 numbers 379,635,274,743,980,835
i read that radix sort runs in O(d(n+k)) time. where d-number of digits
,n=6,k=each digit range.
But after the elements are sorted on LSB ,to find next digit we need to
perform / and % operation
379 /10 = 37 and 37 %10= 7
so it is taking
@gaurav
didn't get this:
Just to increase the size of the string by one.
Then you can put any character at the the new last position, which is 'l'.
can u pls explain that?
On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote:
Ok, Thanks
On Fri, Aug 5, 2011 at 2:53
201 - 221 of 221 matches
Mail list logo