[algogeeks] pls help

2011-08-04 Thread Kamakshii Aggarwal
given a set of letters and a length N, produce all possible output.(Not permutation). For example, give the letter (p,o) and length of 3, produce the following output(in any order you want, not just my example order) ppp ppo poo pop opp opo oop ooo another example would be given (a,b) and length

[algogeeks] Re: compiler

2011-08-04 Thread Gene
This depends on the compiler and to some extent on the language. But in most cases, temporary values are stored in registers first. When there are not enough registers, the compiler spills them into space allocated in a stack activation record so that the space is automatically reclaimed when th

Re: [algogeeks] compiler

2011-08-04 Thread Gaurav Menghani
Yes. On Fri, Aug 5, 2011 at 11:06 AM, krishna meena wrote: > For any compiler generated temporaries the space is allocated in run > time heap only? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to

[algogeeks] compiler

2011-08-04 Thread krishna meena
For any compiler generated temporaries the space is allocated in run time heap only? -- 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 t

Re: [algogeeks] MICRSOFT WRITEN TEST

2011-08-04 Thread siddharam suresh
thank you Thank you, Siddharam On Fri, Aug 5, 2011 at 10:51 AM, Poised~ wrote: > try this: > https://groups.google.com/forum/?hl=en#!topic/algogeeks/Mbah1QXrJB4 > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussio

Re: [algogeeks] MICRSOFT WRITEN TEST

2011-08-04 Thread Poised~
try this: https://groups.google.com/forum/?hl=en#!topic/algogeeks/Mbah1QXrJB4 -- 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/-/pB2VUcnr9igJ. To post to this

Re: [algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
@Dipankar: thanks a lot. Thank you, Siddharam On Fri, Aug 5, 2011 at 10:47 AM, Dipankar Patro wrote: > @ Sidharam: > Best of Luck for the interviews. I hope you crack it! > Normal Algo and OS questions will be asked. I don'y think you need any > advice, you will do just fine. > > On 5 August 20

Re: [algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread Dipankar Patro
@ Sidharam: Best of Luck for the interviews. I hope you crack it! Normal Algo and OS questions will be asked. I don'y think you need any advice, you will do just fine. On 5 August 2011 10:38, Arun wrote: > @Sidharam > Sorry! > I just missed a point.It should be fine. > > On Aug 5, 10:00 am, sidd

[algogeeks] MICRSOFT WRITEN TEST

2011-08-04 Thread siddharam suresh
can someone tell me about the microsoft interview written test (i mean what kind of questions, puzzles, programs will be asked)? some links and documents will be helpful. Thank you, Siddharam On Fri, Aug 5, 2011 at 10:38 AM, Arun wrote: > @Sidharam > Sorry! > I just missed a point.It should be

[algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread Arun
@Sidharam Sorry! I just missed a point.It should be fine. On Aug 5, 10:00 am, siddharam suresh wrote: > @ toarunb...@gmail.com: > can you tell me flaw in algo(or sample input)! > Thank you, > Siddharam > > > > > > > > On Fri, Aug 5, 2011 at 10:28 AM, Arun wrote: > > @Sidharam > > > I dont think

Re: [algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
@ toarunb...@gmail.com: can you tell me flaw in algo(or sample input)! Thank you, Siddharam On Fri, Aug 5, 2011 at 10:28 AM, Arun wrote: > @Sidharam > > I dont think your idea goes along with the sample i/p & o/p > > On Aug 5, 9:35 am, siddharam suresh wrote: > > my idea is "go for inorder tra

Re: [algogeeks] Least Common Ancestor in an n ary tree

2011-08-04 Thread Gaurav Menghani
If there are N nodes and it is an n-ary tree, O(N) pre-processing is required for every node, storing its parent in each step. Subsequently, if LCA(u,v) is to be found, produce the list of ancestors A(u) and A(v), which can be done in O(log-n N) steps. Then compare A(u) and A(v) to find the furth

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
thank you people. i am attending microsoft interview. Any suggestions,questions,puzles will be help full. Thank you, Siddharam On Fri, Aug 5, 2011 at 10:24 AM, Aman Goyal wrote: > I know dat, but i think inorder traversal solutn is better, cos in level > order case, it wud be difficult to find

[algogeeks] Re: Largest Bst in a binary tree.

2011-08-04 Thread Arun
@Sidharam I dont think your idea goes along with the sample i/p & o/p On Aug 5, 9:35 am, siddharam suresh wrote: > my idea is "go for inorder traversal find the longest sorted sequence in > traversal thats the *'largest BST in a binary tree.'* " > Thank you, > Siddharam > > > > > > > > On Fri, A

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread sagar pareek
nice one suresh !! On Fri, Aug 5, 2011 at 10:23 AM, Dipankar Patro wrote: > if you are looking for the largest height, then the inorder approach will > work. > > @ Siddharam Suresh: you are right. The question is if the inorder is > sorted, is the only necessary condition for BST? > > > On 5 Aug

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
I know dat, but i think inorder traversal solutn is better, cos in level order case, it wud be difficult to find the subset tht is the largest BST.. @Siddharam : i think your solution is correct.. On Fri, Aug 5, 2011 at 10:20 AM, Dipankar Patro wrote: > > checking for BST node is quite simple.

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Dipankar Patro
if you are looking for the largest height, then the inorder approach will work. @ Siddharam Suresh: you are right. The question is if the inorder is sorted, is the only necessary condition for BST? On 5 August 2011 10:19, siddharam suresh wrote: > i didnt get *increasing inorder traversal of

[algogeeks] Least Common Ancestor in an n ary tree

2011-08-04 Thread ankit sambyal
Find LCA in n ary tree ? -- 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] Largest Bst in a binary tree.

2011-08-04 Thread Dipankar Patro
checking for BST node is quite simple. by definition, p is a node of bst if (p->left < p < p->right) each node should satisfy this condition in BST. (except for the exterior nodes) On 5 August 2011 10:13, Aman Goyal wrote: > @siddharam: nice approach, just a query increasing inorder traversa

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
i didnt get *increasing inorder traversal of a tree*? as per my knowledge inorder traversal of BST always give sorted data/value. Thank you, Siddharam On Fri, Aug 5, 2011 at 10:13 AM, Aman Goyal wrote: > @siddharam: nice approach, just a query increasing inorder traversal of > a tree is a

Re: [algogeeks] Data Structure to design logn LCA

2011-08-04 Thread Aman Goyal
thanks gaurav ! On Fri, Aug 5, 2011 at 9:45 AM, Gaurav Menghani wrote: > On Fri, Aug 5, 2011 at 9:41 AM, Aman Goyal wrote: > > You receive a series of online queries : "Give nearest common ancestor of > > u,v " . Your objective is to preprocess the tree in O(n) time to get a > data > > structure

[algogeeks] merging trees

2011-08-04 Thread Aman Goyal
You are given two height balanced binary search trees T and T', storing m and n elements respectively. Every element of tree T is smaller than every element of tree T'. Every node u also stores height of the subtree rooted at it. Using this extra information how can you merge the two trees in time

[algogeeks] Amazon online test

2011-08-04 Thread Shachindra A C
Hi All, Has anyone attended Amazon online test? If so, please let me know what kind of questions will be asked and what subjects to prepare for? -- Regards, Shachindra A C -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
@siddharam: nice approach, just a query increasing inorder traversal of a tree is a sufficient condition to check for a BST ? On Fri, Aug 5, 2011 at 10:05 AM, siddharam suresh wrote: > my idea is "go for inorder traversal find the longest sorted sequence in > traversal thats the *'largest BST

Re: [algogeeks]

2011-08-04 Thread Gaurav Menghani
I agree with Dilip. It depends upon what type of input you have at hand. - Suppose you have an array having a million elements, where the elements are in the range 1-3, counting sort would be perfect. - However, if the range is from -10^18 to +10^18, counting sort, which requires O(R) memory, wher

Re: [algogeeks] Google Telephonic interview

2011-08-04 Thread surender sanke
@Anand Shastri, if tasks enter randomly in runtime, structure needs to add a member start_time, which will be different from reference_time (till now u been considering it as same start time of every task). finally GOOD work!! surender On Fri, Aug 5, 2011 at 9:42 AM, Gaurav Menghani wrote: > The

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread siddharam suresh
my idea is "go for inorder traversal find the longest sorted sequence in traversal thats the *'largest BST in a binary tree.'* " Thank you, Siddharam On Fri, Aug 5, 2011 at 10:00 AM, Aman Goyal wrote: > while dequing a node from the queue, how will u check whether a bst > property is sattisfie

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
@sagar : I m confused of how that can be done.. could u elaborate On Fri, Aug 5, 2011 at 10:00 AM, Aman Goyal wrote: > while dequing a node from the queue, how will u check whether a bst > property is sattisfied or not ?.. > > > On Fri, Aug 5, 2011 at 9:49 AM, Dipankar Patro wrote: > >> I have

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
while dequing a node from the queue, how will u check whether a bst property is sattisfied or not ?.. On Fri, Aug 5, 2011 at 9:49 AM, Dipankar Patro wrote: > I have some upto this much currently. > Modify the Breadth First traversal (BFT) a bit. maintain two queues, one is > for original traver

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread sagar pareek
it can easily be done with help of level order traversal. On Fri, Aug 5, 2011 at 9:49 AM, Dipankar Patro wrote: > I have some upto this much currently. > Modify the Breadth First traversal (BFT) a bit. maintain two queues, one is > for original traversal. > > Start from root, BFT. when you

[algogeeks] merging two bst's

2011-08-04 Thread Aman Goyal
You are given two height balanced binary search trees T and T', storing m and n elements respectively. Every element of tree T is smaller than every element of tree T'. Every node u also stores height of the subtree rooted at it. Using this extra information how can you merge the two trees in time

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Dipankar Patro
I have some upto this much currently. Modify the Breadth First traversal (BFT) a bit. maintain two queues, one is for original traversal. Start from root, BFT. when you dequeue a node, check if it satisfies the condition for BST. if yes add the the node to auxiliary queue, if not, leave it and ad

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread sukran dhawan
cpp = cp is valid.other one is not valid because the compiler places cp in read only memory.so we cannot change its address On Fri, Aug 5, 2011 at 12:43 AM, Ankur Khurana wrote: > dev cpp par chal jaenge , > ideone.com par try kar > cp=cpp nahi chalega . . > > > On Fri, Aug 5, 2011 at 12:40 AM, K

Re: [algogeeks] Data Structure to design logn LCA

2011-08-04 Thread Gaurav Menghani
On Fri, Aug 5, 2011 at 9:41 AM, Aman Goyal wrote: > You receive a series of online queries : "Give nearest common ancestor of > u,v " . Your objective is to preprocess the tree in O(n) time to get a data > structure of size O(n) so that you can answer any such query in O(log n) > time. Segment tr

Re: [algogeeks] Google Telephonic interview

2011-08-04 Thread Gaurav Menghani
Then that has to be mentioned in the question. Premature optimization is the root of all evil, in the words of Don Knuth. On Fri, Aug 5, 2011 at 9:38 AM, Anand Shastri wrote: > what if new task gets added every time. > > On Thu, Aug 4, 2011 at 8:24 PM, Gaurav Menghani > wrote: >> >> Instead of a

[algogeeks] hi algogeeks

2011-08-04 Thread sekhar NITK
hello algogeeks, AIRVANA NETWORKS is coming to our campus next week can any one suggest me the pattren and modal paper interviews etc -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogee

[algogeeks] Data Structure to design logn LCA

2011-08-04 Thread Aman Goyal
* Nearest Common Ancestor* Given a rooted tree of size * n *. You receive a series of online queries : * "Give nearest common ancestor of u,v " *. Your objective is to preprocess the tree in * O(n) * time to get a data structure of size * O(n) * so that you can answer any such query in * O(log n)

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
Yes, that can be a liable case definitely!!! On Fri, Aug 5, 2011 at 9:35 AM, Dipankar Patro wrote: > The question is a bit tricky. > Is it possible that the largest BST is somewhere in deeper depth, i.e. it > is not necessarily consisting of the root? > > On 5 August 2011 08:46, Aman Goyal

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread sekhar NITK
hello algogeeks, AIRVANA NETWORKS is coming to our campus next week can any one suggest me the pattren and modal paper interviews etc -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogee

Re: [algogeeks] Google Telephonic interview

2011-08-04 Thread Anand Shastri
what if new task gets added every time. On Thu, Aug 4, 2011 at 8:24 PM, Gaurav Menghani wrote: > Instead of a heap, sort the array once. Pick the first element every > time, and remove it from the array, or just move the 'head pointer' > ahead. > > On Fri, Aug 5, 2011 at 8:01 AM, Anand Shastri >

Re: [algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Dipankar Patro
The question is a bit tricky. Is it possible that the largest BST is somewhere in deeper depth, i.e. it is not necessarily consisting of the root? On 5 August 2011 08:46, Aman Goyal wrote: > How to find the largest BST in a binary tree. > > > > 15 > / \ > 10__ 20 > / \ > 5 _7 > /

Re: [algogeeks] Google Telephonic interview

2011-08-04 Thread Gaurav Menghani
Instead of a heap, sort the array once. Pick the first element every time, and remove it from the array, or just move the 'head pointer' ahead. On Fri, Aug 5, 2011 at 8:01 AM, Anand Shastri wrote: > /* Create a Timer Task that takes in the running time and it's associated >    function to be call

[algogeeks] Largest Bst in a binary tree.

2011-08-04 Thread Aman Goyal
How to find the largest BST in a binary tree. 15 / \ 10__ 20 / \ 5 _7 / \ 2_ __5 / \/ 0 8 3 The largest BST (may or may not include all of its descendants) from the above example should be: 15 / \ _10 20 / 5 Please do not post working code, logic/algorithm or link

Re: [algogeeks] Google Telephonic interview

2011-08-04 Thread Anand Shastri
/* Create a Timer Task that takes in the running time and it's associated function to be called after its running time is elapsed */ #include #define NUM 5 typedef void (*funcToBeCalled)(void); typedef struct timer TIMER; struct timer { int runningTime; funcToBeCalled func; }; static TIM

Re: [algogeeks] Re: C++ doubt

2011-08-04 Thread Shachindra A C
Hi Amit, Thanks for your reply. I digged out google and found out that this kind of conversion(downcasting from base class to derived class) can lead to unexpected behaviour. However, I fail to understand how the print function was actually called inspite of it not being in the base class. I woul

Re: [algogeeks]

2011-08-04 Thread dilip makwana
But beware all linear sort algo have some prior constraints (such as range of input is predefined or such ...) So choose one properly On 4 August 2011 23:12, Samba Ganapavarapu wrote: > Merget Sort sorts O(n log n) time, > Counting sort, Radix sort sorts in O (n) time... > > > On Thu, Aug

[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread vetri
it's working fine on both dev and ideone.com On Aug 5, 12:13 am, Ankur Khurana wrote: > dev cpp par chal jaenge , > ideone.com par try kar > cp=cpp nahi chalega . . > > On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal > wrote: > > > > > > > > > > > i have a doubt regarding 3rd questions..acc t

Re: [algogeeks] Re: pointer question

2011-08-04 Thread Aditya Virmani
it has 4bytes in memory, pointed by the char pointer...just remember *(s+1) means jump by the size of pointer(here char); so it will print first byte in 1st cycle, & so on... On Thu, Aug 4, 2011 at 10:11 PM, Vijay Khandar wrote: > Thanks, but can u elaborate some more explanation, that how for lo

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
is dat enough sagar as der is only limited question.. On Fri, Aug 5, 2011 at 1:48 AM, sagar pareek wrote: > i posted a link above in this thread...go and practice on it > > > On Fri, Aug 5, 2011 at 1:44 AM, Gyanendra Kumar > wrote: > >> thnx abhishek cud u plz guide me how to prepare in very sh

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
i posted a link above in this thread...go and practice on it On Fri, Aug 5, 2011 at 1:44 AM, Gyanendra Kumar wrote: > thnx abhishek cud u plz guide me how to prepare in very shrt tym... > > On Fri, Aug 5, 2011 at 1:38 AM, abhishek kumar < > mailatabhishekgu...@gmail.com> wrote: > >> i have appea

Re: [algogeeks] puzzle

2011-08-04 Thread Anirudh Reddy
am i allowed to stand at the 100 m point? -- 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.

Re: [algogeeks] amazon

2011-08-04 Thread saurabh modi
*longest increasing continuous subsequence length=longest increasing subsequence length in my previous mail. -- 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

[algogeeks] Re: puzzle

2011-08-04 Thread Dave
@Himanshu: That is easy for any boy scout. :-) Tie the rope at the top of the tower. Then tie a sheepshank knot of a comfortable length in the rope and cut the middle strand inside the knot. Climb down the rope to the peg and tie the other end of the rope onto the peg. Then, while standing on or ha

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
thnx abhishek cud u plz guide me how to prepare in very shrt tym... On Fri, Aug 5, 2011 at 1:38 AM, abhishek kumar < mailatabhishekgu...@gmail.com> wrote: > i have appeared for Samsung. so here i am giving some idea. > written section > first round: All reasoning question were based on puzzles l

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
yeah sorry i forgot abt technical round On Fri, Aug 5, 2011 at 1:38 AM, abhishek kumar < mailatabhishekgu...@gmail.com> wrote: > i have appeared for Samsung. so here i am giving some idea. > written section > first round: All reasoning question were based on puzzles like sitting > arrangement(li

Re: [algogeeks] amazon

2011-08-04 Thread Gyanendra Kumar
cud any1 plz state some of the coding n designing question of MS On Fri, Aug 5, 2011 at 1:11 AM, Kamakshii Aggarwal wrote: > I am from Nsit..adobe and MS have visited till now.. > > > On Fri, Aug 5, 2011 at 12:48 AM, sagar pareek wrote: > >> sorry kamakshi u are 5th one who is asking the same que

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread abhishek kumar
i have appeared for Samsung. so here i am giving some idea. written section first round: All reasoning question were based on puzzles like sitting arrangement(little bit tough). -25 que and 20on DI rest 5 on simple apti. second round: (for c/c++) 30 ques were asked for 30 mins. 20 questions was

[algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Dave
@Kamakshii: Do a binary search on a[i] - a[i-1]. If this is negative, i is in the decreasing range, i.e., i < k, so reset the lower limit of the interval. If it is positive, i is in the increasing range, i.e., i > k, so reset the upper limit of the interval. Quit when the interval length is 1. Let

[algogeeks] BST

2011-08-04 Thread Rahul Mittal
www.spoj.pl/problems/BST/ -- 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] amazon

2011-08-04 Thread saurabh modi
the simplest solution for longest increasing continuous array length is O(n) and the simplest solution for longest increasing continuous subsequence length is O(n^2). a solution for spiral is http://www.ideone.com/ygjsq -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
so how many get shortlisted after apti round...??? On Fri, Aug 5, 2011 at 1:29 AM, Gyanendra Kumar wrote: > ohkay..:-) > > > On Fri, Aug 5, 2011 at 1:27 AM, sagar pareek wrote: > >> but here students were more >> like we have >> 66 mca >> 60 M.Tech >> 140 B.Tech CSE >> 60 B.Tech IT >> >> but how

Re: [algogeeks] Re: friend function

2011-08-04 Thread mohit verma
@ amir this is operator overloading using friend but the question is to overload the friend function itself. On Thu, Aug 4, 2011 at 5:32 PM, Amir wrote: > *// Using friend functions to overload addition and subtarction operators* > #include > > class myclass > { > int a; > int b; > > public: >

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
ohkay..:-) On Fri, Aug 5, 2011 at 1:27 AM, sagar pareek wrote: > but here students were more > like we have > 66 mca > 60 M.Tech > 140 B.Tech CSE > 60 B.Tech IT > > but how many got registered for samsung i dont know > as it was one of the initials company > > > On Fri, Aug 5, 2011 at 1:25 AM, s

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
thnx a lot man.:-) MS is also visiting on 11th aug any suggestion or hint abt long type question n coding On Fri, Aug 5, 2011 at 1:25 AM, sagar pareek wrote: > hmmm i think 38 + > > On Fri, Aug 5, 2011 at 1:24 AM, Gyanendra Kumar > wrote: > >> thnx a lot sagar for suggestion >> cud i know t

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
but here students were more like we have 66 mca 60 M.Tech 140 B.Tech CSE 60 B.Tech IT but how many got registered for samsung i dont know as it was one of the initials company On Fri, Aug 5, 2011 at 1:25 AM, sagar pareek wrote: > hmmm i think 38 + > > > On Fri, Aug 5, 2011 at 1:24 AM, Gyanendra

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
hmmm i think 38 + On Fri, Aug 5, 2011 at 1:24 AM, Gyanendra Kumar wrote: > thnx a lot sagar for suggestion > cud i know tentative cutoff of apti over der > > > On Fri, Aug 5, 2011 at 12:57 AM, sagar pareek wrote: > >> and yes attempt reasoning first >> >> >> On Fri, Aug 5, 2011 at 12:56 AM,

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
thnx a lot sagar for suggestion cud i know tentative cutoff of apti over der On Fri, Aug 5, 2011 at 12:57 AM, sagar pareek wrote: > and yes attempt reasoning first > > > On Fri, Aug 5, 2011 at 12:56 AM, sagar pareek wrote: > >> i m sorry but i wasn't able to sit in samsung >> but i can give

Re: [algogeeks] My senior's Interview Experience at Microsoft who got selected and offered a 16lacks package

2011-08-04 Thread mohit verma
ohh my bad... the array should be 1-D with N ptrs for each fgets() we put returned ptr to array and after getting loop back N times. On Thu, Aug 4, 2011 at 11:52 PM, mohit verma wrote: > How did the "microsoft guy" write tail without using seek()? > one solution to this : continuously read file

Re: [algogeeks] amazon

2011-08-04 Thread sagar pareek
oh common only O(n) is the solution its very simple On Fri, Aug 5, 2011 at 1:18 AM, Nikhil Gupta wrote: > Any efficient solution for the longest increasing subsequence? > > > On Fri, Aug 5, 2011 at 1:11 AM, Kamakshii Aggarwal > wrote: > >> I am from Nsit..adobe and MS have visited till now.. >>

Re: [algogeeks] Microsoft Internship

2011-08-04 Thread sukran dhawan
yes he is right.we need to use an array of size 128 as a hash table :) On Wed, Aug 3, 2011 at 10:58 PM, Anurag atri wrote: > Exactly , easy questions will be asked , make sure you catch given hints :) > > > On Wed, Aug 3, 2011 at 9:01 PM, coder coder > wrote: > >> the interviewers are asking eas

Re: [algogeeks] amazon

2011-08-04 Thread sagar pareek
hmmm thats why dipankar was asking the same i came to know that same set of questions even that 3 coding questions were same in MS thats why he was asking for amazon well adobe is coming shortly here... i think on 9th On Fri, Aug 5, 2011 at 1:11 AM, Kamakshii Aggarwal wrote: > I am fr

Re: [algogeeks] amazon

2011-08-04 Thread Nikhil Gupta
Any efficient solution for the longest increasing subsequence? On Fri, Aug 5, 2011 at 1:11 AM, Kamakshii Aggarwal wrote: > I am from Nsit..adobe and MS have visited till now.. > > > On Fri, Aug 5, 2011 at 12:48 AM, sagar pareek wrote: > >> sorry kamakshi u are 5th one who is asking the same quest

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread sukran dhawan
there is a lot of difference between declaration and definition ! functions can be declared inside structures in c++ because it is an added extension in c++ On Fri, Aug 5, 2011 at 1:12 AM, sagar pareek wrote: > same i told u before > > > On Fri, Aug 5, 2011 at 1:07 AM, Ankur Garg wrote: > >> @S

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread sagar pareek
same i told u before On Fri, Aug 5, 2011 at 1:07 AM, Ankur Garg wrote: > @Sagar > > Pls check the below code ..I found this from google :P > > > http://forums.devshed.com/c-programming-42/declaring-function-in-structure-in-c-545529.html > > Guess now u can undestand my question and if possible

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread sukran dhawan
whenever there is a question of two different things in probability we shud add the probabilities of two separate things . so the answer 11/23 posted by muthuraj is right On Wed, Aug 3, 2011 at 10:42 PM, muthu raj wrote: > 5) > Sample space=24C2= 276 > N(S) = 12 C 2 + 12 C 2 =132 > > Probability=

Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
I am from Nsit..adobe and MS have visited till now.. On Fri, Aug 5, 2011 at 12:48 AM, sagar pareek wrote: > sorry kamakshi u are 5th one who is asking the same question... > here in my college approx 10 companies have come from last 15-17 days > amazon was first of them > > so i m so sorry.

[algogeeks] Re: C++ doubt

2011-08-04 Thread Amit
static_cast<> does not do run time type checking. That's why base class pointer can be changed to drived class though it actually is a base class pointer. Now its a drived class pointer, you can call drived class functions. If you use dynamic_cast<> instead of static_cast<>, it will throw a bad ca

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread sukran dhawan
@muthuraj yes he is right On Wed, Aug 3, 2011 at 10:42 PM, muthu raj wrote: > 5) > Sample space=24C2= 276 > N(S) = 12 C 2 + 12 C 2 =132 > > Probability= 132/276= 11/23 > > > *Muthuraj R > IV th Year , ISE > PESIT , Bangalore* > > > > > On Wed, Aug 3, 2011 at 10:36 PM, Prakash D wrote: > >> assu

[algogeeks] LCS help!!!

2011-08-04 Thread Victor Manuel Grijalva Altamirano
I tried the problem 111 of ACM UVA, History Grading... http://uva.onlinejudge.org/external/1/111.html But in the case: 10 3 1 2 4 9 5 10 6 8 7 1 2 3 4 5 6 7 8 9 10 4 7 2 3 10 6 9 1 5 8 3 1 2 4 9 5 10 6 8 7 2 10 1 3 8 4 9 5 7 6 I get 6 4 10 5 And the solution it´s : 9 5 10 9 Why??? Here it´s m

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Ankur Garg
@Sagar Pls check the below code ..I found this from google :P http://forums.devshed.com/c-programming-42/declaring-function-in-structure-in-c-545529.html Guess now u can undestand my question and if possible provide help On Thu, Aug 4, 2011 at 3:33 PM, sagar pareek wrote: > @ ankur > > firs

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread sagar pareek
@ ankur first tell me diff b/w class and structure in reference to C++; answer is :- in structure all data members are by default public and in class its private all the left characteristics like inheritance, overloading etc can be done on both even u can inherit a structure from a class and vi

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
and yes attempt reasoning first On Fri, Aug 5, 2011 at 12:56 AM, sagar pareek wrote: > i m sorry but i wasn't able to sit in samsung > but i can give u a very good link > this link is 4 ur data interpretation... > but can practice for others like C, reasoning etc... > > main thing in samsung ap

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
i m sorry but i wasn't able to sit in samsung but i can give u a very good link this link is 4 ur data interpretation... but can practice for others like C, reasoning etc... main thing in samsung apti paper is that no negative marking is there but u have to attempt 50 questions in 60 mins. so pls

Re: [algogeeks] amazon

2011-08-04 Thread sagar pareek
sorry kamakshi u are 5th one who is asking the same question... here in my college approx 10 companies have come from last 15-17 days amazon was first of them so i m so sorry. i remembered only a few which will not be enough 4 u like they gave some questions on recursion of trees i rememb

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Ankur Garg
sorry guys cudnt put question properly :P..my bad ..:(( the question i wanted to ask was Why cant functions be declared or defined in structures in C but can be done in C++ ? On Thu, Aug 4, 2011 at 2:45 PM, Himanshu Srivastava < himanshusri...@gmail.com> wrote: > afcose strcutures can be decl

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Ankur Khurana
dev cpp par chal jaenge , ideone.com par try kar cp=cpp nahi chalega . . On Fri, Aug 5, 2011 at 12:40 AM, Kamakshii Aggarwal wrote: > i have a doubt regarding 3rd questions..acc to me both are valid...what is > the correct answer? > > > On Fri, Aug 5, 2011 at 12:27 AM, newOne wrote: > >> 2 issue

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Kamakshii Aggarwal
i have a doubt regarding 3rd questions..acc to me both are valid...what is the correct answer? On Fri, Aug 5, 2011 at 12:27 AM, newOne wrote: > 2 issues: > 1. no error handling for malloc failure( can be ignored) > 2. no memset for p&q. > > strcat will not work properly: as by definition it will

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
Thnx a lot sagar As i heard of samsung is almost asking same question in most of the organisation. if u happened to see D papers of samsung could u please elaborate me dat from where to study for apti as this is the most difficult n eliminating round(around 80% get rejected in dis round).or could

Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
@sagar:can u please post the questions that were asked? On Fri, Aug 5, 2011 at 12:20 AM, sagar pareek wrote: > same procedure told by arvind were also followed here too > > > On Thu, Aug 4, 2011 at 11:02 PM, arvind kumar wrote: > >> Yup..they asked us to code 2. >> >> >> On Thu, Aug 4, 2011 at 1

[algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread newOne
2 issues: 1. no error handling for malloc failure( can be ignored) 2. no memset for p&q. strcat will not work properly: as by definition it will search for the null char in first string, removes it then copies the second string including the null char of second string. -- You received this messa

Re: [algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread sagar pareek
1st round apti total 50 questions 25 data interpretation 25 reasoning then 1 interview(tech) + 1 hr and then u will be selected On Fri, Aug 5, 2011 at 12:18 AM, Gyanendra Kumar wrote: > As samsung is visiting our campus very soon so i need help regarding > aptitude of samsung from those where

Re: [algogeeks] Puzzle

2011-08-04 Thread Himanshu Srivastava
oh ok..thankshalf part which was kept inside the wellmeans well must be full..that is 100ok got it completely thank u:) On Fri, Aug 5, 2011 at 12:18 AM, sagar pareek wrote: > double 87.5 gives you 175 > 100 will be used by 1st well and 75 will be used by second >

Re: [algogeeks] puzzle

2011-08-04 Thread Himanshu Srivastava
suppose u tie the rope at 200mt height and now climb down to 100m heightthen u tie the rope at that point then how will you open the rope at point above 200mt where u have tied it earlier On Thu, Aug 4, 2011 at 11:15 PM, mohit verma wrote: > can't we tie the rope where we are standing (at he

Re: [algogeeks] Re: Puzzle

2011-08-04 Thread ankit sambyal
@aditi:Thats a non uniform rope. The 1st half may burn faster than 2nd half. btw Priyanka's solution is correct. -- 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 f

Re: [algogeeks] amazon

2011-08-04 Thread sagar pareek
same procedure told by arvind were also followed here too On Thu, Aug 4, 2011 at 11:02 PM, arvind kumar wrote: > Yup..they asked us to code 2. > > > On Thu, Aug 4, 2011 at 11:01 PM, Kamakshii Aggarwal > wrote: > >> @arvind:in technical online test,do we have to code the program? >> >> >> On Thu

[algogeeks] Samsung India electronics pvt. ltd

2011-08-04 Thread Gyanendra Kumar
As samsung is visiting our campus very soon so i need help regarding aptitude of samsung from those where it has already visited. thnx in anticipation Gyanendra IIIT Gwalior -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this

Re: [algogeeks] Puzzle

2011-08-04 Thread sagar pareek
double 87.5 gives you 175 100 will be used by 1st well and 75 will be used by second now second well will double the 75 and will give you 150 100 will be used by second and remainder 50 will forwarded to third now third one use 50 and will double it to 100 no remainder left i think its clear n

[algogeeks] Re: merging of two sorted arrays

2011-08-04 Thread Amit
Consider two array arr_a[] and arr_b[]. Suppose Number of elements in arr_a[] are n and number of elements in arr_b[] are m. size of arr_a[] is n and size of arr_b[] is m. MergeInPlace(int arr_a[], int arr_b[],int n,int m) { int a =0;b=0,k=0,key=0; for(;b0){ arr_b

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Himanshu Srivastava
afcose strcutures can be declared.classes are not declared!!! On Fri, Aug 5, 2011 at 12:13 AM, Dipankar Patro wrote: > Structures can very well be declared in C: > struct student{ > char name[20]; > int roll; > }s1; > > Are you talking about Classes? > > > On 4 August 2011 23

Re: [algogeeks] Puzzle

2011-08-04 Thread Himanshu Srivastava
i mean @sagar:how did you get 87.5%?? On Fri, Aug 5, 2011 at 12:13 AM, Himanshu Srivastava < himanshusri...@gmail.com> wrote: > @nikhil:how did you get 87.5%?? > > On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek wrote: > >> 87.5 % >> >> On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta >> wrote: >> >>

  1   2   3   >