[algogeeks] Max difference of Monotonic Pair in An Array

2014-04-18 Thread Tushar Kanta Rath
Hi All, Can anyone help me solving this problem ? Given a non-empty array A consisting of N integers. Find Max(j-i), s.t 0=i=jN and A[i]=A[j] Here (i, j) is a Monotonic Pair, satisfying the above condition. Space Complexity : O(n) Time Complexity: O(n) -- Regards... -- You received this

Re: [algogeeks] least common ancestore bst

2013-04-26 Thread Tushar Patil
@rahul : It's fine solution, but can we check the root-data == n1 || n2 before calling function recursively, I think if we check this condition 1st it will reduce unnecessary function calls. Correct me if i am wrong? Thanks, Tushar Patil. On Sun, Apr 21, 2013 at 10:26 PM, rahul sharma

[algogeeks] Re: Amazon Interview Questions

2013-02-17 Thread Tushar
It looks as if you have just pasted some Amazon interview questions on this forum. These are pretty common questions. Try to come up with your own answers. Do some research on google and previous posts on this forum. You'll get answers to all of them. If you have some idea and want to discuss

Re: [algogeeks] help to give DP solution

2012-09-17 Thread Tushar
www.ams.jhu.edu/~castello/362/Handouts/*hungarian*.pdf This PDF might be helpful On Sunday, 16 September 2012 16:42:25 UTC+5:30, Rahul Kumar Patle wrote: @atul: in Hungarian Algorithms works for minimization of cost where the terminating condition is based on zeros.. in my problem what

[algogeeks] Re: Matrix Searching

2012-09-16 Thread Tushar
For a large list of words, At each location, look for the character before/after that character in the word on opposite sides of the initial location, and continue from there Is it like: frequency count of 'a' is smallest 'a' is in 2 words available and alpha shall we check for 'v' near 'a';

Re: [algogeeks] help to give DP solution

2012-09-16 Thread Tushar
we can assign minimum possible value, like negative infinity to the diagonal elements. Then they would not be considered for maximizing the sum. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] array problem

2012-09-16 Thread Tushar
@srikanth we can use segment trees to get sum of an interval but there is another condition of sum of distinct numbers only. how can we take that into account in a segment tree? On Thursday, 6 September 2012 17:35:59 UTC+5:30, srikanth reddy malipatel wrote: post the logic not the code! BTW

[algogeeks] Re: Programming Problem

2012-07-25 Thread Tushar
i think we cannot change the order of the characters On Thursday, 19 July 2012 11:00:20 UTC+5:30, gobind hemb wrote: String s is called *unique* if all the characters of s are different. String s2 is *producible* from string s1, if we can remove some characters of s1 to obtain s2. String

[algogeeks] Re: Amazon support engineer

2012-07-24 Thread Tushar
this is interview street post here freely all the best On Monday, 23 July 2012 19:40:12 UTC+5:30, rahul sharma wrote: Guys i am having amazon support engg. test tonyt...90 min 27 questions mcq...plz tell how to prepare and wats dis profyl???reply asap..and sory for posting it in algogeeks

Re: [algogeeks] Appropriate data structure

2012-07-16 Thread Tushar
can you please elaborate on usage of stack to do it in O(1)? -- 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/-/8jTvBVdzsmYJ. To post to this group, send email

[algogeeks] Re: how to solve

2012-04-12 Thread Tushar
2 3 1 1 1 5 1 2 3 1 2 O/P should be: 0 6 Your O/P is 3 9 -- 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/-/4pcRBMXAvXQJ. To post to this group, send email

[algogeeks] Re: Array Problem

2012-02-15 Thread TUSHAR
@amrit,@Pranav and others : Thanks a lot.. On Feb 15, 11:35 am, amrit harry dabbcomput...@gmail.com wrote: @tushar lower bound for sorting an array is nlogn.http://www.bowdoin.edu/~ltoma/teaching/cs231/fall11/Lectures/6-moreso... On Wed, Feb 15, 2012 at 11:16 AM, TUSHAR tusharkanta.r

[algogeeks] Array Problem

2012-02-14 Thread TUSHAR
Given an array of size N having numbers in the range 0 to k where k=N, preprocess the array inplace and in linear time in such a way that after preprocessing you should be able to return count of the input element in O(1). Please give some idea !! Thanks.. -- You received this message

[algogeeks] Re: Array Problem

2012-02-14 Thread TUSHAR
That means,,,we have to sort the array first in O(n). Is there any way to sort the array inplace in O(n) ? -- 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] plz help...

2011-09-14 Thread Tushar Kanta Rath
hello, i want a good reference in web designing.can anyone plzz help me with some good links, for reference.. plzz its urgent Thanks in Advance -- Tushar Kanta Rath, Master In Computer Application MNNIT, Allahabad -- You received this message because you

Re: [algogeeks] apti

2011-08-21 Thread Tushar Bindal
from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website

Re: [algogeeks] Re: GS on campus

2011-08-07 Thread Tushar Bindal
you were not given any essay during the written round? and if you can get your friends to tell us what kind of puzzles were asked? just a bit of info on that. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-06 Thread Tushar Bindal
://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] difference between the two

2011-08-06 Thread Tushar Bindal
end at 16 not 12 so that p2 starts at 8's multiple. This is done by padding pointer by 4bytes in both I and II struct. declarations. Hope i made it clear...! Thanks. On 8/6/11, Tushar Bindal tushicom...@gmail.com wrote: http://www.serc.iisc.ernet.in/ComputingFacilities

Re: [algogeeks] Re: Puzzle

2011-08-05 Thread Tushar Bindal
/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] MICRSOFT WRITEN TEST

2011-08-05 Thread Tushar Bindal
. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.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

Re: [algogeeks] difference between the two

2011-08-05 Thread Tushar Bindal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College

Re: [algogeeks] pls help

2011-08-05 Thread Tushar Bindal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed

Re: [algogeeks] Why this is giving run time error ?

2011-08-04 Thread Tushar Kanta Rath
. On 4 August 2011 11:00, TUSHAR tusharkanta.r...@gmail.com wrote: #includestdio.h main() { int j=4,i; goto L; for(i=0;ij;i++) { L: printf(%d,j); } } why this is giving infinite

Re: [algogeeks]

2011-08-04 Thread Tushar Kanta Rath
I also think Radix sort..as it runs in linear TCcorrect me If i m wrong. And in terms of minimum time of memory access , which sort is best ?? . Does it means minimum swap procedures -- You received this message because you are subscribed to the

[algogeeks] Give an efficient search algo

2011-08-03 Thread TUSHAR
1. Given an array of n-elements ? the 1st k -elements are in descending order and k+1 to n elements are in ascending order. give an efficient algo for searching an element ? 2. Given an array of n-elements ? each element in the array is either same or less by 1 or larger by 1 from

Re: [algogeeks] Give an efficient search algo

2011-08-03 Thread Tushar Kanta Rath
these are asked in CITRIX ? pl share possible logics.. -- 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

Re: [algogeeks] Re: Give an efficient search algo

2011-08-03 Thread Tushar Bindal
:( On Wed, Aug 3, 2011 at 3:44 PM, Dave dave_and_da...@juno.com wrote: @Tushar: For problem 1, do a binary search on elements 1 to k, and if no hit is found, do a binary search on elements k+1 to n. For problem 2, suppose that you are searching the given array for the number 2

Re: [algogeeks] Call by reference

2011-08-03 Thread Tushar Bindal
Shashank, In C++ we implement it thru reference variables in the function call we can say func(x); in the definition we have, func(int a) whatever changes we make to a in func() are reflected back in x in the calling function In C, we can simulate i t through pointers call : func(x);

Re: [algogeeks] pointer size

2011-08-03 Thread Tushar Bindal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob

Re: [algogeeks] Call by reference

2011-08-03 Thread Tushar Bindal
?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Call by reference

2011-08-03 Thread Tushar Bindal
that is exactly what i thought thanks for the clarification -- 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] Why this is giving run time error ?

2011-08-03 Thread TUSHAR
#includestdio.h main() { int j=4,i; goto L; for(i=0;ij;i++) { L: printf(%d,j); } } why this is giving infinite loop.Runtime error ? -- You received this message

Re: Re: Re: [algogeeks] Re: MS

2011-08-02 Thread Tushar Bindal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College

Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Tushar Bindal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message

Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Tushar Bindal
Suppose that our rabbits never die and that the female always produces one new pair (one male, one female) *every month from the second month on * @Priyanka You have answer 288 I added 178 to it because I got the answer that 89 females would have given birth in the last month. Pls clarify. Are

Re: [algogeeks] Re: binary search tree question!!!!

2011-07-30 Thread Tushar Bindal
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: Novell - Puzzle

2011-07-30 Thread Tushar Bindal
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com

Re: [algogeeks] Re: Novell - Puzzle

2011-07-30 Thread Tushar Bindal
nikhilgupta2...@gmail.comwrote: For rabbits, answer is 256. On Sat, Jul 30, 2011 at 8:33 PM, Tushar Bindal tushicom...@gmail.comwrote: for rabbits answer would be different from cows as they give birth to a pair at a time, so at any time odd number of rabbits won't be there On Sat, Jul

Re: [algogeeks] Re: rotate a matrix NVIDIA question

2011-07-28 Thread Tushar Bindal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received

Re: [algogeeks] Re: rotate a matrix NVIDIA question

2011-07-28 Thread Tushar Bindal
If this is the case, we can follow this method: take variables 1. dir = 1 2. st_col=0 3. end_col = n-1 4. st_row = 1 5. end_row = n-1 6. row = 0 7. col = n-1 8. noOfCellsVisited = 0 dir are as follows: 1 - left ro right 2 - top to bottom 3 - right to left 4 - bottom to top row will keep account

Re: [algogeeks] Re: rotate a matrix NVIDIA question

2011-07-28 Thread Tushar Bindal
There will be following changes to this while(noOfCellsVisitedmn) { if(dir == 1) { for i = st_col to end_col { print arr[row][i]; noOfCellsVisited++} dir++; end_col--; row = n-1-row; } else if(dir==2) { for i = st_row to end_row { print arr[i][col]; noOfCellsVisited++} dir++; end_row--;

Re: [algogeeks] Re: rotate a matrix NVIDIA question

2011-07-28 Thread Tushar Bindal
i am sorry for givin such a naive solution and making so many mistakes. i still left a mistake in dir==4 * col=n-1-(col+1);* -- 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] Re: rotate a matrix NVIDIA question

2011-07-28 Thread Tushar Bindal
thanks amit for this code i tried this for the first time and am still not over finding out my mistakes (got another one while trying it out on an array) yours was an easy one :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] Re: Facebook Interview question at NIT Warangal

2011-07-28 Thread Tushar Bindal
though the code given by siddharth seems to be a bit tough to understand due to one long statement, it gives a good idea to run the main loop fron 2^k -1 to (2^k - 1)*(2^(n-k)) since these rae the only numbers having k digits set -- You received this message because you are subscribed to the

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-28 Thread Tushar Bindal
can't we include -9 , 3 , 1, 5 , 0 as a possible sub array? -- 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

Re: [algogeeks] Re: Contiguous subarray with sum zero

2011-07-28 Thread Tushar Bindal
yup i got it now. nice code -- 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

Re: [algogeeks] Puzzle

2011-07-28 Thread Tushar Bindal
we can just infer that at the point where the man met the driver, from that point, it takes 10 minutes to reach the office (assuming that car moves at same uniform speed all the time) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] Re: size of self referential structure

2011-07-28 Thread Tushar Bindal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you

[algogeeks] write an scanf that reads only a to z charchter.............

2011-07-26 Thread TUSHAR
write an scanf that reads only a to z charchter. -- 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

Re: [algogeeks] Re: write an scanf that reads only a to z charchter.............

2011-07-26 Thread Tushar Kanta Rath
thanks to all . :) -- 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

Re: [algogeeks] reverse a line.

2011-07-21 Thread Tushar Kanta Rath
1st reverse each word in place.then reverse the whole sentenceit will give the required *answer* -- Tushar Kanta Rath, Master In Computer Application MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] Re: Puzzle

2011-07-17 Thread Tushar Bindal
thanks sagar for this wonderful shortcut but can you please explain it better. in what cases can we use this approach? -- 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] Re: Puzzle

2011-07-17 Thread Tushar Bindal
thankyou :) -- 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, visit this

Re: [algogeeks] c++ output

2011-07-17 Thread Tushar Bindal
@varun you are contradicting your own statement when inline replaces the code at place where it is called, then this code will work fine. and the other one w/o inline won't as explained by others also. there seems to be some confusion in your statement. -- Tushar Bindal Computer Engineering

Re: [algogeeks] puzzle-plz explain stepwise

2011-07-14 Thread Tushar Bindal
yx - xy = x0y - yx = (10y + x) - (10x + y) = (100x + y) - (10y + x) 9y - 9x = 99x - 9y 18y = 108x y=6x Since, x comes in hundreds place, we know it can only be 1 as the difference between the 3 digit number and two digit number is difference of two 2 digit numbers only. thus, y=6*1 = 6 a

Re: [algogeeks] apti Q

2011-07-07 Thread Tushar Bindal
the clock has become faster by 48 seconds in 10800 minutes i.e., 1 sec in 225 minutes from 8am on sunday we have to go 225*5*60 minutes behind to get time when clock showed the correct time. i.e., 67500 minutes or 44 days 1260 minutes 44 days 21 hours which means clock showed correct timing at

Re: [algogeeks] Re: Puzzle

2011-07-07 Thread Tushar Bindal
probability that i win standing at second position: 1/365 third position : 364/365*2/365 = 1/365)*(628/365) fourth position : 364/365*363/365*3/365 4th : 364/365*363/365*362/365*4/365 nth position: (365-1)*(365-2)*(365-3)*(365-4)*(365-5).*(365-(n-2))*(365-(n-1))*(n)*(1/365)^n -- You

Re: [algogeeks] Re: Puzzle

2011-07-07 Thread Tushar Bindal
Sorry for the previous post the last line was incorrect it should have been (n+1)th position I was just writing roughly and pressed send instead of save. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: Puzzle

2011-07-07 Thread Tushar Bindal
- n +1)*(n)} / {365*(n-1)} maximum probability is at nth position if at (n+1)th position, {(365 - n +1)*(n)} / {365*(n-1)} -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received

Re: [algogeeks] puzzle

2011-07-07 Thread Tushar Bindal
Sumit, the answer is 14 I think the example of 16 that they take on careerplus is probably confusing you. -- 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

Re: [algogeeks] Re: Puzzle

2011-07-07 Thread Tushar Bindal
Sory once again for that incomplete answer. The complete one is here. probability that i win standing at second position: 1/365 probability that i win standing at third position : 364/365*2/365 = 1/365)*(628/365) probability that i win standing at fourth position : 364/365*363/365*3/365

Re: [algogeeks] Re: help to code

2011-07-06 Thread Tushar Bindal
Evenly divisible simply means that a number should be completely divisible by the given numbers, i.e., it should give a whole number as an answer when divided by that particular number. Evenly divisible doesn't mean that quotient should be an even number. It just needs to be a whole number.

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-06 Thread Tushar Bindal
. 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College

Re: [algogeeks] Puzzle

2011-07-06 Thread Tushar Bindal
- win-win situation For a change the easier method is faster as well -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Reversing the order of words in String

2011-07-06 Thread Tushar Bindal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering

Re: [algogeeks] Reversing the order of words in String

2011-07-06 Thread Tushar Bindal
, Jul 6, 2011 at 10:16 PM, saurabh singh saurab...@gmail.com wrote: I have proposed my solution in one of the previous posts.Check the solution there On Wed, Jul 6, 2011 at 10:10 PM, Tushar Bindal tushicom...@gmail.com wrote: good job but how can this be done in one traversal as asked

Re: [algogeeks] puzzle

2011-07-06 Thread Tushar Bindal
/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] puzzle

2011-07-06 Thread Tushar Bindal
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google

Re: [algogeeks] puzzle

2011-07-06 Thread Tushar Bindal
@Navneet Didn't get your point -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: puzzle

2011-07-06 Thread Tushar Bindal
the solution is given herehttp://www.thecareerplus.com/?page=resourcescat=150subCat=10qNo=2 but can anyone lease explain it better please give a original solution and stop making rude comments about answers posted genuinely. If you have an original solution, please post it. -- You received this

Re: [algogeeks] help to code

2011-07-05 Thread Tushar Bindal
I think you are getting it wrong. Surender, your solution says that numbers divisible by all of the first 5 prime numbers will be taken into account whereas the question says that only the numbers *not* evenly divisible by *any* of the first 5 prime numbers are to be added. Shiv, you are making

Re: [algogeeks] help to code

2011-07-05 Thread Tushar Bindal
If my interpretation is right, following should be the code. int main() { int userInteger = 0; cout Enter A Number endl; cin userInteger; // Ask For a number from the user if (userInteger 0) // Is the number valid? { int result = 0; int prime[5] = { 2, 3, 5, 7, 11 }; int a,b, count = 0;

Re: [algogeeks] Re: spoj--two squares problem

2011-05-28 Thread Tushar Bindal
that theorem is for odd primes 9 is not an odd prime so we can;t apply this theorem -- 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

Re: [algogeeks] A SIMPLE C++ PROGRAM.

2011-04-29 Thread Tushar Bindal
Manish is right. This would start from the left. In cout also processing starts from left. The processing is from right in the printf statement. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com Website: www.jugadengg.com

Re: [algogeeks] Re: Stroustrup C++ BOOK

2011-04-27 Thread Tushar Bindal
I have the book but I hope there are no issues with ths book being shared here. I don't have the link now. would it be fine if I share the book directly? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Cracking the IT interview: jump start your career with confidence

2011-04-26 Thread Tushar Bindal
is there anyone who has this book? -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: Stroustrup C++ BOOK

2011-04-26 Thread Tushar Bindal
searching in the group did not help please give the link to your previous post or better give the link once again -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com Website: www.jugadengg.com -- You received this message

Re: [algogeeks] Re: Stroustrup C++ BOOK

2011-04-26 Thread Tushar Bindal
Is this one fine? http://www.megaupload.com/?d=YSSE195C -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-04-24 Thread Tushar Bindal
Plz mail the book to me too -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com Website: www.jugadengg.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: Google puzzles

2011-03-30 Thread Tushar Bindal
Arpit The formula that you have written is wrong. You would have approached it correctly but the formula written here is incorrect. m= n + (n**1/6* + (n-1)) + ((n**7/6* + (n-1))**1/6* + n-2) +.. If you add all the terms there should be 1/6 in these terms as the terms give the number of

Re: [algogeeks] Re: Construct Binary Tree From Ancestor Matrix

2011-03-30 Thread Tushar Bindal
a[i][j]=1 if 'i' is a parent to 'j' But in your matrix, a[1][2] = 1 a[1][3] = 1 a[2][3] = 1 a[4][2] = 1 a[4][3] = 1 You have taken 'j' to be a parent to 'i' -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com -- You

Re: [algogeeks] Re: debugging contest

2011-03-26 Thread Tushar Bindal
xxx, yyy are considered as cases? -- 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

Re: [algogeeks]

2011-02-19 Thread Tushar Bindal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Fwd: SANKALAN 2011:DUCSS Annual Technical Festival

2011-02-18 Thread Tushar Bindal
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Fwd: SANKALAN 2011:DUCSS Annual Technical Festival

2011-02-18 Thread Tushar Bindal
jus a promotional activity. We thot here ppl discuss on technical topics so it wud b gr8 to enlighten ppl vd such fest whr ppl compete n exchange knowledge. Sorry if we broke ne rule for the group. On Fri, Feb 18, 2011 at 11:57 PM, Tushar Bindal tushicom...@gmail.comwrote: how can you send

[algogeeks] DCE techfest

2011-02-17 Thread Tushar Bindal
***DELHI TECHNOLOGICAL UNIVERSITY* *(Formerly DELHI COLLEGE OF ENGINEERING)** CSI-DTUPHOENIX'11 presents FIREWALL* *The Art Of Hacking * * * Do you swear by having the key to every single lock? Do you think you possess the innate talent of finding loopholes in anything and

[algogeeks] Delhi College of Engineering techfest competition

2011-02-17 Thread Tushar
DELHI TECHNOLOGICAL UNIVERSITY (Formerly DELHI COLLEGE OF ENGINEERING) PHOENIX'11 presents

Re: [algogeeks] Binary Tree Amazon

2011-02-14 Thread Tushar Bindal
It would be *vertcal_sum(root-right,level+1); *in the last line -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Special Binary Tree Again

2011-02-14 Thread Tushar Bindal
I think the following algo should work: 1. Create a DLL of the inorder traversal of the tree 2. for each node, check whether P of that node points to the previous node in the DLL or not. 3. If not, assign it value NULL -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob

Re: [algogeeks] interview quest..

2011-02-14 Thread Tushar Bindal
/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar Bindal
=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] no. of passwords

2011-02-09 Thread Tushar Bindal
this group at http://groups.google.com/group/algogeeks?hl=en. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tusharbin...@jugadengg.com, tushicom...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar
sorry. did not go thru it thoroughly earlier. got it now. On Feb 9, 7:35 pm, Tushar Bindal tushicom...@gmail.com wrote: what are f1, f2, f3,...? On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote: Input: n meetings A meeting e(i) has start time s(i) and finish time

Re: [algogeeks] Re: Frequently one of the Top Question Asked in Amazon

2011-01-31 Thread Tushar Bindal
bittu, you have written this code at end of main() *printGivenOrder(start); printList(rslt);* so the BT in spiral order should be printed twice But you are getting a extra 4 only in place of the whole tree because of these lines *temp=current; current=head; rslt=appnd(temp,current); * There

Re: [algogeeks] Re: Single linked list questions.

2011-01-06 Thread Tushar Bindal
Is it necessary that the two lists are merging at their ends?? Do we have to find whether they merge at the end into same lists or wheter they are just intersecting?? On Thu, Jan 6, 2011 at 10:04 PM, Aditya adit.sh...@gmail.com wrote: There are two aspects here for second question. 1. to

Re: [algogeeks] Re: Single linked list questions.

2011-01-06 Thread Tushar Bindal
have one pointer to the next. So, if they intersect they will definitely be merging. On Thu, Jan 6, 2011 at 11:01 PM, Tushar Bindal tushicom...@gmail.comwrote: Is it necessary that the two lists are merging at their ends?? Do we have to find whether they merge at the end into same lists

[algogeeks] Recaman's sequence

2009-12-02 Thread Tushar Ghosh
++ (giving O(n) time and memory for generating sequence), but I somehow feel that there can be a better approach to check if a term already exists in the sequence. Any suggestion would be gratefully acknowledged. Regards, Tushar -- You received this message because you are subscribed to the Google

[algogeeks] Shaastra Online Programming Contest

2008-09-12 Thread Tushar Rathee
hundreds of participants from all over the world. The total prize money at stake is INR 70,000. Other than this, there are several other programming contests. Please visit www.shaastra.org for more details. Regards Tushar Rathee Publicity Core Shaastra 2008