[algogeeks] Hackathon in NCR, Mid october register yourself now for the event

2012-09-15 Thread Nitin Naresh
we are hosting a hackathon in October 12th evening to 14th evening. The theme is to develop something related to mobile. you can build anything from a construction app, to women security app on a mobile so its not a constraint but rather an enabler. More Details at http://www.opencof

[algogeeks] Interview question

2011-11-29 Thread Nitin Garg
*What are the different ways to say, the value of x can be either a 0 or a 1.* -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post

Re: [algogeeks] Sub-array problem

2011-11-29 Thread Nitin Garg
t; algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because you are subscribed t

[algogeeks] facebook interview question

2011-11-28 Thread Nitin Garg
Find the min and max in an array. Now do it in less than 2n comparisons. (they were looking for the solution that finds both max and min in about 3/2 n comparisons). -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message b

Re: [algogeeks] Re: Linear time Binary tree re-construction

2011-11-28 Thread Nitin Garg
A[1,n,1,n] will give us the solution. On Mon, Nov 28, 2011 at 7:47 PM, Nitin Garg wrote: > Lets say the in-order traversal is O = O1,O2,...On > Pre-order is P = P1,P2,...Pn > > Lets assume that the in-order traversal gives sorted sequence of numbers. > (if not, we can replace

Re: [algogeeks] Re: Linear time Binary tree re-construction

2011-11-28 Thread Nitin Garg
to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because you are subscr

Re: [algogeeks] Suggest Algo: OffCampus Apple Interview Question

2011-11-28 Thread Nitin Garg
p://groups.google.com/group/algogeeks?hl=en. > > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algo

Re: [algogeeks] Re: Google Question--Suggest Algo

2011-11-28 Thread Nitin Garg
43/30 ~ 1.433 > > > > > > > > > Optimal split: [0,0,1,1,0,0][1,1][0,1,1,0] > > > > > > > Expected value of optimal split: 1/3 + 1 + 1/2 = 11/6 ~ > 1.8333 > > > > > > > > > Source -> > > > > > ht

Re: [algogeeks] Re: Google Question--Suggest Algo

2011-11-28 Thread Nitin Garg
> > Expected value of optimal split: 1/3 + 1 + 1/2 = 11/6 ~ >> 1.8333 >> > >> > > > > > Source -> >> > >http://stackoverflow.com/questions/8189334/google-combinatorial-optim. >> .. >> > >> > > > > >

[algogeeks] Google interview question

2011-11-26 Thread Nitin Garg
Hi Guys I saw this question http://stackoverflow.com/questions/8189334/google-combinatorial-optimization-interview-problm But couldn't get the solution which has been accepted, nor could work out one on my own. Please help! -- Nitin Garg "Personality can open doors, but only Characte

Re: [algogeeks] Re: array searching

2011-11-24 Thread Nitin Garg
hl=en. >> >> >> >> >> > >> > >> > -- >> > Somnath Singh >> > >> >> >> -- >> Somnath Singh >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algo

Re: [algogeeks] Re: An Array Problem

2011-11-24 Thread Nitin Garg
to >> > > > > >>> algogeeks+unsubscr...@googlegroups.com. >> > > > > >>> For more options, visit this group at >> > > > > >>>http://groups.google.com/group/algogeeks?hl=en. >> > >> > > > > &

Re: [algogeeks] Does Y lies between x and z

2011-11-24 Thread Nitin Garg
om. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because you are subscribed to the Google Groups "Algorithm Geek

Re: [algogeeks] Re: Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted

2011-11-24 Thread Nitin Garg
sage 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 group

Re: [algogeeks] Amazon Question

2011-11-14 Thread Nitin Garg
t; > > On Sun, Nov 13, 2011 at 1:55 PM, UTKARSH SRIVASTAV < > usrivastav...@gmail.com> wrote: > >> @Surinder give some proof or logic >> >> >> On Sun, Nov 13, 2011 at 10:25 AM, surender sanke wrote: >> >>> @nitin >>> yes i meant the same

Re: [algogeeks] Amazon Question

2011-11-12 Thread Nitin Garg
If yes, how do you prove it? On Sat, Nov 12, 2011 at 8:18 PM, Nitin Garg wrote: > I can prove that the size of resulting string will be 1 or 2. > > @surender - > what do you mean by no of distinct characters? they are 3 in this case - > a,b and c. > Do you mean to say that the

Re: [algogeeks] Amazon Question

2011-11-12 Thread Nitin Garg
gt;>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> > -- > 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] What Data Structure to use ?

2011-10-29 Thread Nitin Garg
mail to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received this message because y

Re: [algogeeks] Re: Searching In a large file

2011-10-29 Thread Nitin Garg
-- >> 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

Re: [algogeeks] Re: Intersection of arrays

2011-10-27 Thread Nitin Garg
gt; -- >> 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...@googlegro

Re: [algogeeks] Re: Find all possible combination of integers for a given sum

2011-10-27 Thread Nitin Garg
eeks@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. >> >> > -- > You received this message becau

Re: [algogeeks] Amazon Onsite

2011-10-24 Thread Nitin Garg
mail 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. > > -- Nitin Garg "Personality can open doors, but only Characte

[algogeeks] Re: Tree Center Problem

2011-10-06 Thread Nitin Nizhawan
anyone? -- 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 grou

[algogeeks] Tree Center Problem

2011-10-05 Thread Nitin Nizhawan
hi, given a tree with N nodes find the node such that its average total distance from each other node is smallest i.e. if nodes are labeled 0N-1 then find i such that[ SUM d(i, j ){0<=jhttp://groups.google.com/group/algogeeks?hl=en.

Re: [algogeeks] Amdocs

2011-10-02 Thread Nitin
If u have any info then pls post otherwise dont waste my time and ur time tooo... On Sat, Oct 1, 2011 at 4:10 PM, shady wrote: > did you search archives before asking ? > > On Sat, Oct 1, 2011 at 4:04 PM, Nitin wrote: > >> Can anybody tell me the procedure of amdocs and the d

[algogeeks] Amdocs

2011-10-01 Thread Nitin
Can anybody tell me the procedure of amdocs and the difficulty level to crack the company?? -- 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

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Nitin Garg
@raju - so it means the input array should be distorted to give the output array. Are you sure about it? i doubt if its possible. On Fri, Sep 30, 2011 at 11:24 PM, raju wrote: > @nitin .. > Output array is not a new array ... you can do anything to input array .. > > ~raju > >

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Nitin Garg
scribe 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. > -- Nitin Garg "Personality can open doors, but only Character can keep them open" -- You received t

Re: [algogeeks] indus valley partner doubt

2011-09-28 Thread Nitin
I dnt know much but one of my frend got selected and they have taken 8 rounds of interviews in a joint placements of ip univ... On Wed, Sep 28, 2011 at 5:40 PM, ravi maggon wrote: > Hey can anyone tell me about the procedure and questions of Indus Valley > Partners?? > > -- > Regards > Ravi Magg

[algogeeks] accenture

2011-09-27 Thread Nitin
can anybody tell me about the pattern of accenture???is is worth going to accenture as a fresher??? -- 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 grou

Re: [algogeeks] Re: MS Question -> Median of a BST without using extra space and in O(n)

2011-09-27 Thread Nitin Garg
m. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googleg

Re: [algogeeks] Samsung campus visit

2011-09-27 Thread Nitin
C questions there are 12 -13 questions given on internet it will be same as it is given in the paper ,i dnt find a link right now otherwise do test ur c skills thoruoghly all c questions will be from that book On Tue, Sep 27, 2011 at 7:47 PM, vartika aggarwal < vartika.aggarwa...@gmail.com> wr

Re: [algogeeks] Amazon Interview Question

2011-09-24 Thread Nitin Garg
options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>>> >>> >>> >>> -- >>> Anup Ghatage >>> >>> -- >>> You received this message because you are subscribed to t

Re: [algogeeks] Re: MICROSOFT IDC

2011-09-23 Thread Nitin Garg
GINEERING > NIT ALLAHABAD > > -- > 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+un

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-21 Thread Nitin Garg
Ohh i totally missed that line. Thanx a lot :) On Wed, Sep 21, 2011 at 10:46 AM, pankaj agarwal < agarwal.pankaj.1...@gmail.com> wrote: > @Nitin Garg > > Question 6 - > > i agree that greater the sum is and greater the probability to getting it. > but in given question if

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 Thread Nitin Garg
Can someone tell answers to question 2 and 5 with explanation?? On Mon, Sep 19, 2011 at 1:40 PM, Nitin Garg wrote: > In Question 4 i just kept counting new processes that are being added in > every iteration. > No. of new processes being created is equal to the already running no.

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 Thread Nitin Garg
, - 0,1,2,3,4 5 4 - 0,1,2,3,4,5,6,7 8 . . . 1,2,3,5,8,11,17,25,38,57,86,129,194 I kept counting, got 194. Don't know of any shortcut. On Mon, Sep 19, 2011 at 1:35 PM, Nitin Garg wrote: > Question 6 - > Intuitively you can see that the greater the sum is, the

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 Thread Nitin Garg
Mon, Sep 19, 2011 at 1:04 PM, Nitin Garg wrote: > Question 3 - > To eliminate one player, you need to host atleast 2 matches and make him > loose in both 2. These 2 matches can not contribute to elimination of any > other player. > So, min 2 matches for every player who is to be el

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 Thread Nitin Garg
wrote: > @Nitin: Answer to question 3 is 50. > > > On Mon, Sep 19, 2011 at 11:44 AM, praveen raj wrote: > >> @nitin Plz explain how u have reached answer of question no. 4 and 6 >> >> On 19-Sep-2011 12:26 AM, "Nitin Garg" wrote: >> > >> >

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-18 Thread Nitin Garg
u 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 opt

Re: [algogeeks] Re: need explanation of this c code

2011-09-05 Thread Nitin
It's 1 on dev c++ On Mon, Sep 5, 2011 at 1:17 PM, Nitin wrote: > > > On Sun, Sep 4, 2011 at 9:22 PM, vivek goel wrote: > >> itz my pleasure . >> so u r pursuing ur engg frm where >> >> i thk its an undefined behaviour

Re: [algogeeks] Re: need explanation of this c code

2011-09-05 Thread Nitin
On Sun, Sep 4, 2011 at 9:22 PM, vivek goel wrote: > itz my pleasure . > so u r pursuing ur engg frm where > > i thk its an undefined behaviour and the answer will vary from compiler to > compiler. > On Sun, Sep 4, 2011 at 7:33 PM, sinjanspecial wrote: > >> tha

Re: [algogeeks] Re: Stack problem

2011-09-04 Thread Nitin Garg
1) time > > -- > 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.co

Re: [algogeeks] very urgent .. help

2011-09-04 Thread Nitin
no need to preapre... questions are very tough.. first attempt verbal... only this section is easy... try to attempt all questions in this section.. Regards: Nitin Kalra Contact Number : 09050760645 Student : Electronics & Communication Engineering Department National Institute of Techno

Re: [algogeeks] Re: memory allocation question

2011-09-03 Thread Nitin Garg
lgogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Piyush Agarwal > Final Year Undergraduate > Department of Computer Engineering > Malaviya National Institute of T

Re: [algogeeks] Algorithms for Interviews

2011-09-03 Thread Nitin Garg
This link worked for me http://www.mediafire.com/?a2ia1j1i0q0pet1 On Sat, Sep 3, 2011 at 9:22 PM, Nitin Garg wrote: > Even i need the book. > Please reshare a working link. > > I am studying computer science at IIT Delhi. > > > On Sat, Sep 3, 2011 at 9:08 PM, vivek goel wr

Re: [algogeeks] Algorithms for Interviews

2011-09-03 Thread Nitin Garg
hl=en. >> >> > -- > 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...@googleg

Re: [algogeeks] dictionary

2011-09-03 Thread Nitin
I think b-tree would help you... On Sat, Sep 3, 2011 at 9:47 AM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > WHY trie? any reason ? > Dictionary means not only to save efficiently and also we have to get back > in almost O(1) time .. I think Hash Table is best suited for this... O

Re: [algogeeks] confusion

2011-08-29 Thread Nitin
thanks:) On Mon, Aug 29, 2011 at 2:21 PM, UTKARSH SRIVASTAV wrote: > int *p[10]=array of pointers meaning they can can point to 10 integer type > locations > int (*p)[10] =pointer of array which can point to an array of size 10 > > > *UTKARSH SRIVASTAV > CSE-3 > B-Tech 3rd Year > @MNNIT ALLAHABAD

[algogeeks] confusion

2011-08-29 Thread Nitin
Please specify the difference between Array of pointer and Pointer to array???it's getting very messy -- 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 thi

Re: [algogeeks] Syllogism

2011-08-23 Thread Nitin Nizhawan
Thus above statement is true if and only it is given that there are some girls who are not Beautiful. On Tue, Aug 23, 2011 at 7:50 PM, Bharat Kul Ratan wrote: > Statement: Some girls are beautiful > IMO , this means you a set of all girls and after that comes statement > about "some" otherwise st

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
Sanjay Rajpal wrote: > @Nitin : could u explain ur logic ? > > > Sanju > :) > > > > On Sun, Aug 21, 2011 at 9:24 AM, Nitin Nizhawan > wrote: > >> @sanjay, oops, my intention was bitwise OR >> >> >> On Sun, Aug 21, 2011 at 4:25 PM, sarvesh

Re: [algogeeks] c question

2011-08-21 Thread Nitin
>> only one bit is reserved for it.so the binary representation is 1.since >> only one bit is present, >> that bit becomes sign nit and hence -1 >> >> On Sun, Aug 21, 2011 at 8:07 AM, saurabh singh wrote: >> >>> Read bit field >&g

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
it needed to convert from base 8 to base 10?? >> >> On Sun, Aug 21, 2011 at 4:07 PM, Sanjay Rajpal wrote: >> >>> Hi your intention was logical OR or BITWISE OR ? >>> >>> u did Logical. >>> Sanju >>> :) >>> >>> >&

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
int num = 0; for(int i=0;iwrote: > int num = 0; > for(int i=0;inum=num||(A[i]<3*i); > } > printf("%d",num); > > I think this will do. > > > On Sun, Aug 21, 2011 at 2:25 PM, sarvesh saran > wrote: > >> Hi, >> >> I have a vector A or an array (for C guys) that contains the octal >> representati

Re: [algogeeks] convert a vector containing octal representation of a number to decimal number

2011-08-21 Thread Nitin Nizhawan
int num = 0; for(int i=0;iwrote: > Hi, > > I have a vector A or an array (for C guys) that contains the octal > representation of a number. > > So the array can be something like: [1,5,7] or [7,7,5,6,3,4,2] etc > > i.e no number in the array can be >= 8. > > Now given this array, I need to convert

[algogeeks] c question

2011-08-20 Thread Nitin
#include main() { struct value { int bit1:1; int bit2:4; int bit3:4; }bit={1,2,2}; printf("%d%d%d",bit.bit1,bit.bit2,bit.bit3); } output is -1,2,2; can anybody tell me the reason that y it is giving -1 ?? -- You received this message because you are subscribed to the Google Groups "Algorith

Re: [algogeeks] Syllogism

2011-08-20 Thread Nitin Nizhawan
@geek_one, its false, "some girls are beautiful does not imply that some girls are not beautiful" On Sat, Aug 20, 2011 at 10:36 PM, Yogesh Bhati wrote: > conclusion : > Is at least some girls are beautiful > > dnt knw abt rest bt some are > > -- > You received this message because you are su

Re: [algogeeks] Syllogism

2011-08-20 Thread Nitin Nizhawan
the second. On Sat, Aug 20, 2011 at 6:49 PM, Nitin Nizhawan wrote: > Statement: > "Some girls are beautiful' Ex B(x) , there exist at least one girl who is > beautiful > "Some girls are not beautiful" Ex !B(x), there exist at least one girl who > is beautiful

Re: [algogeeks] Syllogism

2011-08-20 Thread Nitin Nizhawan
Statement: "Some girls are beautiful' Ex B(x) , there exist at least one girl who is beautiful "Some girls are not beautiful" Ex !B(x), there exist at least one girl who is beautiful I do not think first implies the second. On Sat, Aug 20, 2011 at 3:13 PM, vikas singh wrote: > > > On Sat, Au

Re: [algogeeks] Re: Make My Trip *URGENT*

2011-08-20 Thread Nitin
MMT selected 5 students from our university those who are selected for development have been asked about there project about there pros and cons and in detailed manner,but people who are selected for the QA they were provided with the puzzles.. On Fri, Aug 19, 2011 at 10:46 AM, snehi jain wr

Re: [algogeeks] Novell questions

2011-08-18 Thread Nitin Gupta
t; > *MOHIT VERMA* > > -- > 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] SISO

2011-08-17 Thread Nitin Gupta
-- > 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 m

Re: [algogeeks] De shaw ques!

2011-08-17 Thread Nitin Nizhawan
N = 935*q + 69 N%38 = 31, 16, 1, 24, 9, 32, 17, 2 for { q = 0,1,2,3,4,5,6,7. } On Wed, Aug 17, 2011 at 5:54 PM, aditya kumar wrote: > @priya . i have shown you my method . write your method and we shall > discuss it . > > > On Wed, Aug 17, 2011 at 5:52 PM, sukran dhawan wrote: > >> >> >>

Re: [algogeeks] What is the reason??

2011-08-17 Thread Nitin Nizhawan
> > > On 17 August 2011 17:19, Nitin Nizhawan wrote: > >> I think this happens because EOF on stream is set when fscanf actually >> tries to read beyond EOF but reads 0 characters and therefore printf prints >> the previous value in "s". >

Re: [algogeeks] What is the reason??

2011-08-17 Thread Nitin Nizhawan
I think this happens because EOF on stream is set when fscanf actually tries to read beyond EOF but reads 0 characters and therefore printf prints the previous value in "s". On Wed, Aug 17, 2011 at 5:11 PM, kumar raja wrote: > > > > while(!feof(fp)) > { > > fscanf(fp,"%s",s); > >

Re: [algogeeks] GS apti ques!

2011-08-17 Thread Nitin Nizhawan
a = (1-0.2) b = (1-0.3) c = (1- 0.4) a*b*(1-c) + a*(1-b)*c + (1-a)*b*c + a*b*c = 0.788 On Wed, Aug 17, 2011 at 5:08 PM, Romil ... wrote: > @Priya: A mistake from my side. The answer should be 1-0.212 i.e. 0.788 > Sorry for this mistake. > @Kumar: Yours is wrong. Check it again. > > > On Wed

Re: [algogeeks] Factorial Algorithms

2011-08-17 Thread Nitin Nizhawan
Aug 12, 2011 at 3:00 PM, Nitin Nizhawan > wrote: > > http://www.luschny.de/math/factorial/FastFactorialFunctions.htm > > Does anyone know of resource for good/detailed explanation of factorial > > algorithms on this site? > > > > -- > > You received this mess

Re: [algogeeks] Re: Number theory

2011-08-17 Thread Nitin Nizhawan
oups. > > If we choose no divider its nC0 , but we dont have to include it > With 1 divider its nC1 > and so on.. > So the total no. of ways will be > (nC0+nC1+nC2..nCn)-nC0= 2^n-1 > > Regards, > Puneet > > On Wed, Aug 17, 2011 at 4:05 PM, Rohit Srivastava &

Re: [algogeeks] SISO

2011-08-17 Thread Nitin Gupta
m this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Nitin Gupta B Tech 3rd yr Information Technology National Institute of Technology, Allahabad -- You received this message

Re: [algogeeks] Prime numbers

2011-08-16 Thread Nitin Nizhawan
Hi Dod, Could you pls expalin what this algorithm is doing and from where you got it. Thanks Nitin On Wed, Aug 17, 2011 at 2:56 AM, Don wrote: > I wrote a program to print prime numbers, but it is not very fast. Can > someone help me figure out why? > > > #include >

Re: [algogeeks] Prime numbers

2011-08-16 Thread Nitin Nizhawan
Can someone pls explain what dod's algorithm is doing? Dod, from where did you get this recursive algo? On Wed, Aug 17, 2011 at 8:45 AM, Dipankar Patro wrote: > Sieve's is the fastest in generating prime numbers. +1 to Sandeep and > Sanjay > > > On 17 August 2011 08:21, Sanjay Rajpal wrote: > >

Re: [algogeeks] Number theory

2011-08-16 Thread Nitin Nizhawan
I think 2^(n-1) - 1 On Tue, Aug 16, 2011 at 8:36 PM, sameer gupta wrote: > no. of ways you can write a no. as sum of other non-zero positive > integers > like 3 can be written in > 3 ways: > 1+1+1, > 1+2 > 2+1 > imp. 2+1 and 1+2 are different > find the answer and give and prove formula for any

Re: [algogeeks] Re: Algorithms For Interviews

2011-08-16 Thread Nitin Nizhawan
sent to you ravi On Tue, Aug 16, 2011 at 8:16 PM, ravi kumar wrote: > > heyy nitin.. it says da file izz locked .. can u mail me da buk.. thanx in > advance > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks"

Re: [algogeeks] Re: Algorithms For Interviews

2011-08-16 Thread Nitin Nizhawan
http://www.fileflyer.com/view/XyBZGA8 On Tue, Aug 16, 2011 at 8:07 PM, Yasir wrote: > Typo: achieves --> archives > > -- > 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

[algogeeks] reason

2011-08-15 Thread Nitin
#include main() { int arr[3]={2,3,4}; char *p; p=arr; p=(char *)((int *)(p)); printf("%d",*p); p=(char *)((int *)(p+1)); printf("%d",*p); } it is giving 2,0 why it is giving 0 ..>?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to t

[algogeeks] reason

2011-08-15 Thread Nitin
#include #define fun(arg) do\ {\ if(arg)\ printf("have fun...","\n");\ }while(i--) main() { int i=6; fun(i<5); } give the answer and please give the reason for this #include #define fun(a,b) a##b main() { int a, b, ab; a = 1, b = 2, ab = 3;

[algogeeks] Factorial Algorithms

2011-08-12 Thread Nitin Nizhawan
http://www.luschny.de/math/factorial/FastFactorialFunctions.htm Does anyone know of resource for good/detailed explanation of factorial algorithms on this site? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send emai

Re: [algogeeks] an array question

2011-08-12 Thread Nitin Nizhawan
radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir wrote: > Kindly check it with both the examples. It won't work. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To

Re: [algogeeks] Design .. how to attack ???

2011-08-11 Thread Nitin Nizhawan
I feel such questions are asked to test OO skills so try to identify all the entities and verbs in the system. Also describing key interfaces in detail should help. On Fri, Aug 12, 2011 at 11:20 AM, MAC wrote: > Hi guys , > > Can anyone help me in understanding what is expected when some some on

Re: [algogeeks] Re: Trees

2011-08-11 Thread Nitin Nizhawan
I am also getting , 5 as answer now. here is what I did. In any n-ary tree we can add one internal node by adding n-children to any one of its leaf nodes. This operation creates one internal node and at the cost one leaf node and adds n new leaf nodes. L(i) be leaf nodes in a tree with i internal

Re: [algogeeks] Trees

2011-08-11 Thread Nitin Nizhawan
i guess answer is c. 4 n*i+1 On Thu, Aug 11, 2011 at 8:01 PM, rShetty wrote: > A complete n- array tree in which each node has n children or no > children, let i be the number of internal nodes and L be the number of > leaves in a complete n- array tree. If L=41 and i=10 what is the value > of

Re: [algogeeks] STL sort

2011-08-10 Thread Nitin Nizhawan
ck(a); } cout<wrote: > sorry, comp is either comp_x or comp_y > > > On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan > wrote: > >> what is "comp" in your code? >> >> >> On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal >> wrote: >

Re: [algogeeks] STL sort

2011-08-10 Thread Nitin Nizhawan
what is "comp" in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal wrote: > I have a vector of stuct, how to sort this vector? > problem is I can't overload the '<' operator in struct definition, as i > want to sort by 'x' one time, and then by 'y'. I tried to write the > comparator fun

Re: [algogeeks] Re: SPOJ CENCRY

2011-08-10 Thread Nitin Nizhawan
inp: 3 eee vfghjklwerf out: cjpvbhntzgm aeiouaeiouae eouaeioicou On Wed, Aug 10, 2011 at 12:40 PM, Nitin Nizhawan wrote: > 3 > eee > cjpvbhntzgm > > aeiouaeiouae > vfghjklwerf > eouaeioicou > > On Wed, Aug 10, 2011 at 12:06

Re: [algogeeks] Re: SPOJ CENCRY

2011-08-10 Thread Nitin Nizhawan
3 eee cjpvbhntzgm aeiouaeiouae vfghjklwerf eouaeioicou On Wed, Aug 10, 2011 at 12:06 PM, kartik sachan wrote: > any body tell the test cases?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this grou

[algogeeks] pre-post decrement

2011-08-08 Thread Nitin
main() { int i=10; int z; z=--i--; } this gives an lvalue required error ,what i want to know is when the post decrement gets executed then whether the expression should be --i or --10,as it is --10 thats y its givin lvalue required error but y is it so as if we increment or decrement using post or

Re: [algogeeks] suggest simple code for

2011-08-08 Thread Nitin Nizhawan
I think this should work void finddepth(Node *node,int depth){ if(node!=NULL){ depth = max( finddepth(node->left,depth+1), finddepth(node->right,depth+1) ); } return depth; } On Mon, Aug 8, 2011 at 6:33 PM, jagrati verma wrote: > finding the depth or height of a tree. > > -- > You r

Re: [algogeeks] Random number

2011-08-08 Thread Nitin Nizhawan
following solution should work but it uses an array so its ST is O(N) #include #include #define MAX 500 /** copied from wikipedia * */ unsigned m_w = time(NULL);/* must not be zero */ unsigned m_z = 300;/* must not be zero */ unsigned long get_random() { m_z = 36969 * (m_z & 655

Re: [algogeeks] m'th max element

2011-08-08 Thread Nitin Nizhawan
Selection algorithm, http://en.wikipedia.org/wiki/Selection_algorithm On Mon, Aug 8, 2011 at 3:59 PM, nick wrote: > how will you find the m'th maximum element in an unsorted array of > integers? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks

Re: [algogeeks] Re: nlogn, in-place, iterative mergesort?

2011-08-07 Thread Nitin Nizhawan
good Joke :) On Mon, Aug 8, 2011 at 1:43 AM, DK wrote: > @Nitin: In-place merge sorts are not stable (atleast I haven't come across > a stable one - you might want to create one as research? ;) ). > > -- > DK > > http://twitter.com/divyekapoor > http://gplus.to/divy

Re: [algogeeks] Re: nlogn, in-place, iterative mergesort?

2011-08-07 Thread Nitin Nizhawan
Thanks everyone, Achieving nlogn, interative, and in-place separately is easy. But I did not know of algo that achieves all these simultaneously for merge sort. Thanks DK for pointing to that paper I wonder if algorithm presented in paper is also stable. --Nitin On Sun, Aug 7, 2011 at 5:10

Re: [algogeeks] nlogn, in-place, iterative mergesort?

2011-08-06 Thread Nitin Nizhawan
inplace? On Sat, Aug 6, 2011 at 10:27 PM, immanuel kingston < kingston.imman...@gmail.com> wrote: > Yes. just remove the recursive part using 2 stacks. > > Thanks, > Immanuel > > On Fri, Aug 5, 2011 at 6:51 PM, Nitin Nizhawan > wrote: > >> does anyone know

Re: [algogeeks] size -------

2011-08-06 Thread Nitin
I am also getting 24 bytes but y it is taking it every data type as 8,8,8 as if we take it alone it is 1 for char and 4 for int and 8 for doble as it is giving 24 which means it is setting every data type as 8 bytes. On Sat, Aug 6, 2011 at 9:28 PM, Aditya Virmani wrote: > i guess it depends on ur

Re: [algogeeks] Directi Question

2011-08-06 Thread Nitin Gupta
1/6*5/6*5/6*3+ 1/6*1/6*5/6*3+ 1/6*1/6*1/6 =91/216 On Sat, Aug 6, 2011 at 8:24 PM, muthu raj wrote: > Microsoft written: > > What is the probability of getting atleast one 6 in 3 attempts of a dice? > > > *Muthuraj R > IV th Year , ISE > PESIT , Bangalore* > > > > > On Sat, Aug 6, 2011 at 7:34 A

Re: [algogeeks] Re: adobe

2011-08-06 Thread Nitin Nizhawan
http://trickofmind.com/?p=1080 i think this will help, we need to find Carmichael number or somthing related to ETF for the input number. On Sat, Aug 6, 2011 at 12:24 PM, Nikhil Gupta wrote: > @sumit, these numbers containing all ones are not in binary representation. > They are in decimal system

Re: [algogeeks] Circle

2011-08-05 Thread Nitin Nizhawan
I think this will do. http://en.wikipedia.org/wiki/Midpoint_circle_algorithm On Fri, Aug 5, 2011 at 7:08 PM, rShetty wrote: > Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without > making use of any floating point > computations at all. > > -- > You received this message because y

Re: [algogeeks] Re: remove duplicate words in a string

2011-08-05 Thread Nitin Nizhawan
@deepika this is a different question, your solution is great for removing duplicate characters. original question is about removing duplicate words. On Fri, Aug 5, 2011 at 7:06 PM, deepikaanand wrote: > ya an array of 256 is surely a wastage of space but this was i couls > think in my microsoft

[algogeeks] nlogn, in-place, iterative mergesort?

2011-08-05 Thread Nitin Nizhawan
does anyone know of any in-place, iterative mergesort algorithm with nlogN worst case complexity? It would be good if it is stable also. TIA Nitin -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, sen

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

2011-08-05 Thread Nitin Nizhawan
if input starts with one or more characters from the string "A telephone girl" then it will give SEG FAULT because it scanf will try to write to CS, else initial value "junk" will be printed On Fri, Aug 5, 2011 at 6:28 PM, Lakshmi Prasad wrote: > for some inputs its giving "junk" as the answer an

  1   2   >