[algogeeks] Regarding Jobs in NCR for my cousin

2014-04-02 Thread Sandeep Jain
whenever you forward. Regards, Sandeep Jain Computer Scientist, Adobe Systems, India -- Forwarded message -- From: priyankalohia19 priyankalohi...@gmail.com Date: Tue, Mar 25, 2014 at 11:07 PM Subject: Resume To: sandeep6...@gmail.com Dear sir, Herein I am attaching my resume

[algogeeks] Adobe India is Hiring

2014-01-08 Thread Sandeep Jain
from Premiere Institutes Bangalore Production Specialist Graphic/Web Design 3+ yrs B.Des or M.Des preferable Noida Regards, Sandeep Jain Computer Scientist, Adobe Systems, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] what wil be o/p

2011-08-03 Thread Sandeep Jain
addresses/pointers have same size irrespective of type to which the pointer points. Regards, Sandeep Jain On Wed, Aug 3, 2011 at 2:42 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: hi i have a slight confusion..i got the above explanation but i have a doubt as in when u say int arr[5

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Sandeep Jain
you can use DIR /S *.java 5) 2 *((12/24)*(11/23)) = 11/23 Regards, Sandeep Jain On Wed, Aug 3, 2011 at 10:43 PM, Dave dave_and_da...@juno.com wrote: @Kamakshii: Yes. 11/23 is correct. Whatever the color of the first sock chosen, there are 11 mates in the 23 remaining socks. Dave On Aug

Re: [algogeeks] Call by reference

2011-08-03 Thread Sandeep Jain
I'd say C language is a truly call-by-value language. C++ supports call-by-reference. However in C we can simulate call-by-reference using pointers and address-of operator. Regards, Sandeep Jain On Wed, Aug 3, 2011 at 11:27 PM, NITIN SHARMA coolguyinat...@gmail.comwrote: As we say in C

Re: [algogeeks] Call by reference

2011-08-03 Thread Sandeep Jain
parameter) won't be reflected in x (actual parameter) However changes in *p are reflected in x, using this the caller's variable is getting modified by the callee. Regards, Sandeep Jain On Thu, Aug 4, 2011 at 10:19 AM, Shashank Jain shashan...@gmail.com wrote: @sandeep, i dint get what do you

Re: [algogeeks] Re: Is it possible to determine an n-ary tree nodes depth given its index?

2011-08-02 Thread Sandeep Jain
Log(N+1) works only for binary tree(lg(N+1). For N-ary tree the formula is a little different. Height of node K = floor( Log N ( (N-1)*K ) ) For binary tree it translates to floor(lgN) Note: I've assumed node index begin from 1 rather than 0 Regards, Sandeep Jain On Mon, Aug 1, 2011 at 5

Re: [algogeeks] c output

2011-08-02 Thread Sandeep Jain
hi is string constant in both cases... However using p[] allocates memory and copies the string hi in it. On Aug 3, 2011 2:17 AM, Radhika Renganathan radi.coo...@gmail.com wrote: thks ravinder.. ! char p[]=hi char *p = hi are both string constants? On Wed, Aug 3, 2011 at 2:08 AM, Ravinder

Re: [algogeeks] what wil be o/p

2011-08-02 Thread Sandeep Jain
Size of an array is calculated as the number of bytes occupied by the array. On Aug 3, 2011 2:02 AM, Ram CEG honest...@gmail.com wrote: array size is 5. so 5*4(size of int)=20. On Wed, Aug 3, 2011 at 1:45 AM, Anuj kumar anonymize...@gmail.com wrote: #includestdio.h #includeconio.h int

Re: [algogeeks] Re: Interview ques

2011-07-31 Thread Sandeep Jain
functions, allow for run time polymorphism among overridden functions.(only when invoked using pointer) btw I'm still trying to think if preventing function over-riding is possible... Regards, Sandeep Jain On Sun, Jul 31, 2011 at 10:13 PM, Ankit Minglani ankit.mingl...@gmail.comwrote: @aditi

Re: [algogeeks] Re: Interview ques

2011-07-31 Thread Sandeep Jain
@Pandharinath: Please consider the following e.g. class A { public: void func(){ /* A'simplementation */} }; class B:public A { public: void func(){/* B's implementation*/ } }; What is B's func() doing? Regards, Sandeep Jain On Sun, Jul 31, 2011 at 10:36 PM, pandharinath gorde

Re: [algogeeks] Re: Interview ques

2011-07-31 Thread Sandeep Jain
Yup.. actually we never get to make proper usage of overridden functions without making them virtual. Regards, Sandeep Jain On Sun, Jul 31, 2011 at 10:55 PM, muthu raj muthura...@gmail.com wrote: Function overriding gains significance only when functions are declared virtual. Otherwise

Re: [algogeeks] Re: Interview ques

2011-07-31 Thread Sandeep Jain
, Sandeep Jain PS: I remember having interview questions such as, What happens when you override a virtual function? On Sun, Jul 31, 2011 at 11:51 PM, pandharinath gorde pandharinath.go...@gmail.com wrote: and one more thing B is containg A's object inside which conatin noramlly vptr if any

Re: [algogeeks] Re: Amazon- Most Common Three sequence

2011-07-25 Thread Sandeep Jain
This is similar to Frequent Pattern algorithms studied under data mining. You may refer FP Growth tree. Regards, Sandeep Jain On Mon, Jul 25, 2011 at 3:46 PM, sravanreddy001 sravanreddy...@gmail.comwrote: how about traversing the list once.. but.. looking at the user level. now.. we make

Re: [algogeeks] C output

2011-07-15 Thread Sandeep Jain
This should help you out. http://msdn.microsoft.com/en-us/library/f90831hc.aspx Regards, Sandeep Jain On Fri, Jul 15, 2011 at 11:15 AM, abhishek kumar mailatabhishekgu...@gmail.com wrote: @Sandeep Jain sandeep, please be more clear about lvalue rvalue assignment. -- You received

Re: [algogeeks] C output

2011-07-14 Thread Sandeep Jain
Yup... *In C++* Pre-Increment Pre-Decrement return LValue Post-Increment Post-Decrement return RValue *In C* Pre-Increment Pre-Decrement return RValue Post-Increment Post-Decrement return RValue Regards, Sandeep Jain On Thu, Jul 14, 2011 at 4:08 PM, T3rminal piyush@gmail.com wrote

Re: [algogeeks] C output

2011-07-14 Thread Sandeep Jain
@ALL: Turbo C is one of the most pathetic compilers I've seen. It has tremendous skills to ruin your concepts. Regards, Sandeep Jain On Fri, Jul 15, 2011 at 10:35 AM, abhishek kumar mailatabhishekgu...@gmail.com wrote: @Gaurav Jain in turbo c++,(this was a c program). it is giving

Re: [algogeeks] Re: Minimum/Maximum Sum path in A Binary Tree

2011-07-13 Thread Sandeep Jain
If we need to find the maximum sum the above code is fine. But from the subject it appears we need to print the path, which contains the maximum sum, as well. Regards, Sandeep Jain On Wed, Jul 13, 2011 at 8:01 PM, Piyush Kapoor pkjee2...@gmail.com wrote: I agree with anonymous

Re: [algogeeks] Re: Minimum/Maximum Sum path in A Binary Tree

2011-07-13 Thread Sandeep Jain
@Vaibhav: How do you intend to populate the array? Regards, Sandeep Jain On Wed, Jul 13, 2011 at 9:45 PM, vaibhav shukla vaibhav200...@gmail.comwrote: @sandeep : then can we just store the nodes in the array.. and as soon as we reach the leaf ,we print the array . what say ? On Wed, Jul

Re: [algogeeks] Re: Improve upon O(m^2)

2011-07-13 Thread Sandeep Jain
perform an compaction operation on 2nd array. Regards, Sandeep Jain On Wed, Jul 13, 2011 at 10:18 PM, ravindra patel ravindra.it...@gmail.comwrote: @Bittu, Vaibhav Can you please illustrate your algo for below arrays. Array1 - {1, 3, 5, 7} Array2 - {0,0,0,2,0,4,6,8} Thanks

Re: [algogeeks] Re: Precedence of operators

2011-07-13 Thread Sandeep Jain
Because ++i returns non -ve i.e. true, and since || operator exhibits short circuit. There was no need to evaluate j++ k++ Regards, Sandeep Jain On Wed, Jul 13, 2011 at 10:21 PM, shady sinv...@gmail.com wrote: has higher precedence than || but why does j and k didn't increase after

Re: [algogeeks] Re: Improve upon O(m^2)

2011-07-13 Thread Sandeep Jain
@Ravindra: Dude, so far in this question, I've always seen 2nd array to contain all elements on one side of the array, as this avoids any constraints on the values allowed within the array. Regards, Sandeep Jain On Wed, Jul 13, 2011 at 10:53 PM, ravindra patel ravindra.it...@gmail.comwrote

Re: [algogeeks] c code bst mirror prob

2011-07-13 Thread Sandeep Jain
Your swap function is not correct. You are swapping p q locally. Since you are using c++, make the following changes. void swap*(node* p,node* q)* { node *t; t=p; p=q; q=t; } Regards, Sandeep Jain On Thu, Jul 14, 2011 at 1:45 AM, Anika Jain anika.jai...@gmail.com wrote: n

Re: [algogeeks] microsoft ques

2011-07-12 Thread Sandeep Jain
the line/col position of starting/closing braces. Each node will have its nested braces as child nodes. PS: In either case make sure you ignore comments and strings literals Regards, Sandeep Jain On Tue, Jul 12, 2011 at 4:43 PM, shilpa gupta shilpagupta...@gmail.comwrote: Write down the c code

Re: [algogeeks] output

2011-07-12 Thread Sandeep Jain
, Refer http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.10 http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.12 Regards, Sandeep Jain On Tue, Jul 12, 2011 at 10:09 PM, dheeraj tyagi dheeraj2...@gmail.comwrote: const means that it cannot be overloaded..i

Re: [algogeeks] output

2011-07-12 Thread Sandeep Jain
was to be created. (You may think of the compiler internally using placement new) Different compilers have different techniques of optimization. Refer http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.10 And as per the above link this should not work on MS C++.NET Regards, Sandeep Jain On Wed, Jul

Re: [algogeeks] Re: questions related to C

2011-07-12 Thread Sandeep Jain
Try it. It should work fine. Regards, Sandeep Jain On Wed, Jul 13, 2011 at 10:40 AM, Aniket Dutta aniketdutt...@gmail.comwrote: what about a generic swap function which works for structures also? On Wed, Jul 13, 2011 at 2:23 AM, Don dondod...@gmail.com wrote: To check for overflow, use

Re: [algogeeks] Re: Yahoo Question

2011-07-11 Thread Sandeep Jain
Option A: Works on all data types Option B: Works on numerical data, (best on integral data) but leads to overflow problem Option C: XOR would solve the problem of overflow, but afaik bitwise operators work on integral data Regards, Sandeep Jain On Mon, Jul 11, 2011 at 12:03 PM, sachin sharma

Re: [algogeeks] Re: remove duplicate chars in a string without using extra memory

2011-07-11 Thread Sandeep Jain
Anika, look closely. Your code takes O(N^2) instead of O(N) Regards, Sandeep Jain On Mon, Jul 11, 2011 at 5:15 PM, Anika Jain anika.jai...@gmail.com wrote: YA.. N YA M USING 2 VARIABLES.. IS IT ALLOWED? On Mon, Jul 11, 2011 at 4:58 PM, saurabh singh saurab...@gmail.comwrote: A similar

Re: [algogeeks] c doubt

2011-07-11 Thread Sandeep Jain
Sunny is right. Try to observe the binary representation, and you shall get your answers. Regards, Sandeep Jain On Mon, Jul 11, 2011 at 5:54 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Can anybody give a full explanation On Sat, Jul 9, 2011 at 10:49 PM, sunny agrawal sunny816.i

Re: [algogeeks] Re: remove duplicate chars in a string without using extra memory

2011-07-11 Thread Sandeep Jain
Hint: What is the time complexity of strlen?? Regards, Sandeep Jain On Mon, Jul 11, 2011 at 8:00 PM, Anika Jain anika.jai...@gmail.com wrote: @sandeep sir: i didnt get it how is it takin o(n^2) ?? On Mon, Jul 11, 2011 at 5:18 PM, Sandeep Jain sandeep6...@gmail.comwrote: Anika, look

Re: [algogeeks] C OUTPUT HELP

2011-07-11 Thread Sandeep Jain
I'll put it in simple words, when printf is executed, it expects the arguments to be of the same type and in the same order as they appear in the format string. Otherwise, it starts to exhibit random behavior whenever a first mismatch occurs. Regards, Sandeep Jain On Tue, Jul 12, 2011 at 1:32

Re: [algogeeks] c++ doubt

2011-07-10 Thread Sandeep Jain
, 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

Re: [algogeeks] c++ doubt

2011-07-10 Thread Sandeep Jain
http://www.parashift.com/c++-faq-lite/virtual-functions.html Its one of my favorite sites... :) Regards, Sandeep Jain On Mon, Jul 11, 2011 at 12:02 AM, himanshu kansal himanshukansal...@gmail.com wrote: thanku sir...sir 1 more thngcn u gv a link or some pdf for studying virtual

Re: [algogeeks] C OUTPUT HELP

2011-07-10 Thread Sandeep Jain
-CIC+3 == M-CIC and 4+\nACM-CIC == \nACM-CIC+4 == -CIC It has nothing to do with format string, rather char* (string literals themselves) *Problem 4:* you are not assigning anything to i Regards, Sandeep Jain On Mon, Jul 11, 2011 at 12:38 AM, nicks crazy.logic.k...@gmail.com wrote: Someone

Re: [algogeeks] C OUTPUT HELP

2011-07-10 Thread Sandeep Jain
. As for input, 2 will automatically be treated as 2.0 when scanf demands a floating value. However, if you enter characters in place of numbers or vice versa. You may experience weird behavior. Regards, Sandeep Jain On Mon, Jul 11, 2011 at 9:37 AM, nicks crazy.logic.k...@gmail.com wrote: @sandeep

Re: [algogeeks] Amazon

2011-07-07 Thread Sandeep Jain
the two nodes selected in step one. We can apply the above logic again on the reduced set that we obtained. In our e.g we get b-c at a distance of 5. All we need to decide now is that which of b or c is near a. This is already given in terms of a-b a-c. Seems ok to me? Regards, Sandeep Jain

Re: [algogeeks] Re: Amazon

2011-07-07 Thread Sandeep Jain
@Sachin: What if the milestones were, A1-A3-A2-A0 in this order? Regards, Sandeep Jain On Thu, Jul 7, 2011 at 6:00 PM, sachin sharma sachin.bles...@gmail.comwrote: What about this: First you have the list of distances between two milestones. Let’s form a table Start milestone End

Re: [algogeeks] Re: Amazon

2011-07-07 Thread Sandeep Jain
@Sachin: What if the milestones were, A1-A3-A2-A0 in this order? Regards, Sandeep Jain On Thu, Jul 7, 2011 at 6:00 PM, sachin sharma sachin.bles...@gmail.comwrote: What about this: First you have the list of distances between two milestones. Let’s form a table Start milestone End

Re: [algogeeks] function overloading in inheritance

2011-07-04 Thread Sandeep Jain
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

Re: [algogeeks] c doubt

2011-07-04 Thread Sandeep Jain
starts to print characters one by one till it finds null, i.e. \0 Thus it prints from hellohi And similarly printing a[1] prints only hi Regards, Sandeep Jain On Mon, Jul 4, 2011 at 1:48 PM, Sangeeta sangeeta15...@gmail.com wrote: #includestdio.h #includestring.h void main() { char a[2

Re: [algogeeks] Implementing QUEUE with Singly link list

2011-07-04 Thread Sandeep Jain
How bout I say, the insertion and deletion functions have the following prototype? void enqueue(NODEPTR q, int data) int deque(NODEPTR q) You are not allowed to maintain two pointers, i.e. no front and no rare pointers... Regards, Sandeep Jain Member of Technical Staff, Adobe Systems, India

Re: [algogeeks] Implementing QUEUE with Singly link list

2011-07-04 Thread Sandeep Jain
); Regards, Sandeep Jain On Tue, Jul 5, 2011 at 8:30 AM, vaibhav agarwal vibhu.bitspil...@gmail.comwrote: @sandeep what is ptr q in case of enqueue? On Mon, Jul 4, 2011 at 12:53 PM, Sandeep Jain sandeep6...@gmail.comwrote: How bout I say, the insertion and deletion functions have

Re: [algogeeks] Implementing QUEUE with Singly link list

2011-07-04 Thread Sandeep Jain
OOPS... I missed again, my bad... both enqueue and deque can take reference. (Sincere apologies...) NO separate data structure is needed. And both operations can definitely be done, in O(n). BTW even if you don't take the reference variable in deque, it can be solved. :) :) Regards, Sandeep Jain

Re: [algogeeks] Re: Interview Question

2011-07-03 Thread Sandeep Jain
I was thinking the same, BUT here the question is that we have two *SETS* and that's the catch. So, XORing all elements of SET A with SET B should result in ZERO only when both the set have same elements. Regards, Sandeep Jain On Sun, Jul 3, 2011 at 11:25 AM, Pranav Agarwal meetpranav

Re: [algogeeks] Re: Interview Question

2011-07-03 Thread Sandeep Jain
-- You can also have character's in place of numbers In all the above cases, you will have time complexity O(n) PS: I'm definitely looking forward to learn a solution, better than O(nLgn) Regards, Sandeep Jain On Sun, Jul 3, 2011 at 1:09 PM, sunny agrawal sunny816.i...@gmail.comwrote

Re: [algogeeks] Optimisation to reduce time...

2011-07-03 Thread Sandeep Jain
Can you give an insight to what exactly this code does? That may help quiet a lot. Regards, Sandeep Jain On Sun, Jul 3, 2011 at 1:17 PM, rajeevrvis rajeev.open.1...@gmail.comwrote: Hi Here is the code . I want to optimize it to run faster . Can Anyone help me??? #includestdio.h void

Re: [algogeeks] find output

2011-07-03 Thread Sandeep Jain
Apoorve, please explain the reason for this output as well Regards, Sandeep Jain On Mon, Jul 4, 2011 at 1:06 AM, Apoorve Mohan apoorvemo...@gmail.comwrote: 5 On Mon, Jul 4, 2011 at 1:01 AM, amit the cool amitthecoo...@gmail.comwrote: int main() { int a[]={5,10,15,8

[algogeeks] Re: 2 D array(dynamic allocation)

2011-07-02 Thread Sandeep Jain
Here's my solution. int** allocateMatrix(int m, int n) { int **rowList = (int**)malloc(sizeof(int)*m*n + sizeof(int*)*m); int *colList = (int*)(rowList+m); int i; for(i=0; im; i++) { rowList[i] = colList+i*n; } return rowList; } And here's the main method to test/understand the

Re: [algogeeks] output plzzzz

2011-07-02 Thread Sandeep Jain
One thing to remember is that, *sizeof* operator does not evaluate the expression used as the parameter, it only evaluates type of the parameter. So, in case 2, sizeof(a) == sizeof(int) == 4. We never actually access 'a' Regards, Sandeep Jain Member of Technical Staff, Adobe Systems, India

[algogeeks] Re: Y shaped linklist

2009-10-09 Thread sandeep jain
Here is one solution http://geeksforgeeks.org/?p=2405 On Fri, Oct 9, 2009 at 9:00 AM, sharad kumar aryansmit3...@gmail.comwrote: space comp O(n) time o(2n) both in terms of worst case On Fri, Oct 9, 2009 at 8:46 PM, ankur aggarwal ankur.mast@gmail.comwrote: @sharad wat about space

[algogeeks] Re: birthday panga

2009-08-28 Thread sandeep jain
How about a hash? On Fri, Aug 28, 2009 at 10:43 AM, Chonku cho...@gmail.com wrote: I think a linked list structure should suffice for this. Since insertions/deletions will not be too frequent. Memory consumption will also be optimum. On Thu, Aug 27, 2009 at 2:49 PM, ankur aggarwal

[algogeeks] Re: Algo to find all the possible subsets in a set

2009-08-27 Thread sandeep jain
Please see http://geeksforgeeks.org/?p=588 Well explained and coded solution. On Thu, Aug 27, 2009 at 5:28 AM, Dave dave_and_da...@juno.com wrote: If the set has fewer elements than an integer has bits, just count from 1 to MAXINT. If bit i is 0, the element is not in the set, and if bit i

[algogeeks] Re: Check divisibility by 3

2009-08-20 Thread sandeep jain
Richa, Did you see http://geeksforgeeks.org/?p=511 I think, above link provides the kind of solution you are looking for On Thu, Aug 20, 2009 at 11:33 PM, Ralph Boland rpbol...@gmail.com wrote: On Aug 16, 7:29 pm, Ralph Boland rpbol...@gmail.com wrote: On Aug 14, 1:45 am, richa gupta