Re: [algogeeks] thanx to all

2012-02-29 Thread Sanjay Rajpal
many congratulations :) * Sanjay Kumar * On Wed, Feb 29, 2012 at 10:59 AM, mohit mishra mohit7mis...@gmail.comwrote: congrats :-) On Wed, Feb 29, 2012 at 10:56 AM, shady sinv...@gmail.com wrote: congrats :) keep participating and keep learning. On Wed, Feb 29, 2012 at 9:19 AM, atul

Re: [algogeeks] Re: google question

2012-02-29 Thread atul anand
@Dave : is it a working code?? i have executed your code but getting wrong output...and value of s is becoming -ve inside loops. -- 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] puzzle

2012-02-29 Thread Anurag atri
nth term : (n! + 2^n - n) On Wed, Feb 29, 2012 at 11:05 AM, Vaibhav Mittal vaibhavmitta...@gmail.comwrote: Ntn else is provided..?? On Feb 28, 2012 12:51 PM, Gaurav Popli abeygau...@gmail.com wrote: Given a sequance of natural numbers. Find N'th term of this sequence. a1=2, a2=4, a3=11,

Re: [algogeeks] puzzle

2012-02-29 Thread shady
anurag how did you reach that solution ? can you elaborate... On Wed, Feb 29, 2012 at 8:11 PM, Anurag atri anu.anurag@gmail.comwrote: nth term : (n! + 2^n - n) On Wed, Feb 29, 2012 at 11:05 AM, Vaibhav Mittal vaibhavmitta...@gmail.com wrote: Ntn else is provided..?? On Feb 28, 2012

Re: [algogeeks] [Offtopic] Wedding Invitation

2012-02-29 Thread Rahul
Do we have to find the shortest path for everyone to get there? :p On 2/29/12, shady sinv...@gmail.com wrote: -- Forwarded message -- From: Algorithm Geeks algogeeks+msga...@googlegroups.com Date: Wed, Feb 29, 2012 at 8:56 PM Subject: algogeeks - Google Groups: Message

Re: [algogeeks] thanx to all

2012-02-29 Thread Siddhartha Banerjee
congrats yaar!!! share your interview experience please!!! -- 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] Structural Padding in C

2012-02-29 Thread Decipher
I need some help in understanding how padding works ?? Please answer the following questions with proper explanations.. struct mystruct1 { char a; int b; short c; long d; }; struct mystruct2 { char a; short b; char c; long d; }; What's the sizeof above 2 structures and why ??

[algogeeks] Re: count possible number of binary search trees, given number of nodes

2012-02-29 Thread Gene
A related interesting problem is counting binary set hierarchies: the number of perfect binary trees you can build over the same set of n=2^k leaves, where there is no distinction between left and right children. In other words, starting with n=2^k elements, put them into disjoint sets of 2

Re: [algogeeks] Structural Padding in C

2012-02-29 Thread atul anand
hope this helps http://www.geeksforgeeks.org/archives/9705 On Wed, Feb 29, 2012 at 9:43 PM, Decipher ankurseth...@gmail.com wrote: I need some help in understanding how padding works ?? Please answer the following questions with proper explanations.. struct mystruct1 { char a;

Re: [algogeeks] [Offtopic] Wedding Invitation

2012-02-29 Thread Dipit Grover
http://yeees.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

[algogeeks] Re: Structural Padding in C

2012-02-29 Thread Gene
This depends on the compiler and even on the options you give the compiler. The C nor C++ standards don't say. So the asker of the question hasn't give you enough information. If you assume 32-bit x86 gcc with no packing options or pragmas, I think shorts (which are 2 bytes long) are aligned on

Re: [algogeeks] puzzle

2012-02-29 Thread Anurag atri
@shady: Observation only .. On Wed, Feb 29, 2012 at 9:03 PM, shady sinv...@gmail.com wrote: anurag how did you reach that solution ? can you elaborate... On Wed, Feb 29, 2012 at 8:11 PM, Anurag atri anu.anurag@gmail.comwrote: nth term : (n! + 2^n - n) On Wed, Feb 29, 2012 at 11:05

[algogeeks] Re: optimisation

2012-02-29 Thread Gene
For big matrices, using all the caches well is very important. The usual approach is block tiling as you say. You want two blocks to fit nicely in the L1 cache. The most highly optimized schemes will have a hierarchy of tiles where two tiles at the second level will fit in the L2 cache, etc.

Re: [algogeeks] Re: Structural Padding in C

2012-02-29 Thread Rahul
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/lecture-notes/MIT6_087IAP10_lec06.pdf On 2/29/12, Gene gene.ress...@gmail.com wrote: This depends on the compiler and even on the options you give the compiler. The C nor

Re: [algogeeks] Re: Structural Padding in C

2012-02-29 Thread Karunakar Reddy
how in the second case it is 12?can u tell the clear expl.. On Wed, Feb 29, 2012 at 8:39 AM, Gene gene.ress...@gmail.com wrote: This depends on the compiler and even on the options you give the compiler. The C nor C++ standards don't say. So the asker of the question hasn't give

[algogeeks] Re: Puzzle

2012-02-29 Thread icy`
hm, very strange set of numbers. If the first number was 38 I *might* see the hints of a pattern, but since it is just 3, I have no idea. [if the first number was ] 38(now +1, or 1 squared) 39 , 41, 43, 45(+4, or 2 squared) 49, 51, 53, 55(+9, or 3 squared) 64, __ __ __ (I

Re: [algogeeks] Re: optimisation

2012-02-29 Thread Arun Vishwanathan
@all: Thanks a lot On Wed, Feb 29, 2012 at 9:02 AM, Gene gene.ress...@gmail.com wrote: For big matrices, using all the caches well is very important. The usual approach is block tiling as you say. You want two blocks to fit nicely in the L1 cache. The most highly optimized schemes will

Re: [algogeeks] thanx to all

2012-02-29 Thread Ravi Ranjan
@all 3 round liye 1.5 hours each only data structure n algorithm n 2 qstns from OS but ultimately the code for synchronization(a mix situation of linked-list n semaphore) they asked linked list tree programs their variations(all to implement in C) i stuck at this place when they tell me to

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

2012-02-29 Thread Mad Coder
then how static can be an extern? Extern means that this variable can be used in other files also, whereas static means this variable is initialized only once and its scope is static with respect to its scope which can be either a function or file. So we cant declare a variable static and extern

Re: [algogeeks] Re: Longest Path in A Graph

2012-02-29 Thread Mad Coder
We can find the longest path in a graph by applying 2 bfs. 1st BFS is from our start node. The node which appear in last will be the one farthest from the start node.Let this node be end1. Now again apply bfs from end1 and the last node which appears will be the another end. Here I have made

[algogeeks] Re: Structural Padding in C

2012-02-29 Thread Gene
Draw a picture! char goes at 0 because it can go anywhere short goes at 2 because it must be on a 2-byte boundary; it consumes bytes 2 and 3 char goes at 4 because this is the next byte after the short; it consumes byte 4; byte 5 is the next byte free long goes at 8 because this is the next

[algogeeks] Re: Longest Path in A Graph

2012-02-29 Thread Gene
This not a bad thought experiment, but sorry this isn't true. First, there is a problem of cycles. If a graph is undirected, you can pick any edge and go back and forth an arbitrary number of times along that edge to make any path as long as you want. So if there exists _any_ path there is no

Re: [algogeeks] thanx to all

2012-02-29 Thread atul anand
didnt get this question :- *minimum separation distance between two nodes of tree * minimum sepration on what basis , is it similar to Dijkstra algo ??? On Wed, Feb 29, 2012 at 11:35 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote: @all 3 round liye 1.5 hours each only data structure n

Re: [algogeeks] thanx to all

2012-02-29 Thread Umer Farooq
congratz dude! :-) And best of luck with your future endeavours. On Wed, Feb 29, 2012 at 11:05 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote: @all 3 round liye 1.5 hours each only data structure n algorithm n 2 qstns from OS but ultimately the code for synchronization(a mix situation of