Re: [algogeeks] INTERVIEW QUESTION

2012-10-27 Thread payal gupta
 the question mentioned is as it isi just copy pasted it here.
@saurabh thanx for the explainaton of the cube problem i guess that is an
appropriate soln for the question.
and for the other question on detection of typos and  suggestion i would
like to know to know what 'k' in your explaination stands for?how are the
values allocated to it ? should it be for each wrong word not mentioned in
the dictionary we got to check if the word exists with edit distance equal
to 1 in dictioanry
and so on until we get the correct word???



on Sat, Oct 27, 2012 at 8:12 AM, Saurabh Kumar  wrote:

> could you please share the link? coz at first glance a Trie looks like a
> bad choice for this task.
>
> I'd go with the Levenshtein distance and a kd-tree.
> First implement the Levenshtein distance algorithm to calculate the edit
> distance of two strings.
> Second, since Levenshtein distance qualifies as a metric space we can use
> a metric tree like BK-tree to populate it with our dictionary.
> Choose a random word from dictionary as a root and subsequently insert
> dictionary words(picking them up randomly) into the tree.
> A node has arbitrary no. of children. The parent-child edge represents the
> corresponding Levenshtein distance between them.
>
> Building the tree is one time process. Once the tree is built we can
> devise a way to serialize it and store it.
>
> Using this tree we can find all the words with edit-distance less than or
> equal to, say k.
> Lets, define a function call in Tree class as: List KDTreeSearch(s, k);
> which searches for all strings s' in the tree such that |s-s'| <= k i.e.
> all strings which are less than or equal to an edit distance of k.
> Searching:
> Start with the Root and calculate the edit-distance of s from root. If
> its', say d then we know exactly which children we need to descend to in
> order to find the words with distance <=k.
>
> Looking for typos:
> Scan the document and for each word 'w' make a call: list =
> KDTreeSearch(w, 0);
> if, list.size() = 1. //We have the word in dictionary.
> else, list = KDTreeSearch(w, 2); // searching for all words with edit
> distance of 2 from w
>
> returned 'list' can sometimes be large, we can subsequently filter it out
> by narrowing down our definition of 'typos'
> e.g. for typo w = REDT [REST is more likely than RENT] or maybe some
> Phoneme model etc you should discuss this at length with the
> interviewer.
>
> On 27 October 2012 07:03, Raghavan  wrote:
>
>> By any chance did you read the new blog post by Gayle Laakmaan..
>>
>> I guess to detect typos we can use some sort of Trie implementation..
>>
>>
>> On Fri, Oct 26, 2012 at 7:50 PM, payal gupta  wrote:
>>
>>>
>>>Given a cube with sides length n, write code to print all possible
>>> paths from the center to the surface.
>>>Thanx in advance.
>>>
>>>
>>>Regards,
>>>   PAYAL GUPTA,
>>>   NIT-B.
>>>
>>>
>>>
>>> --
>>> 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/-/ZaItRf_9A_IJ.
>>>
>>> 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.
>>>
>>
>>
>>
>> --
>> Thanks and Regards,
>> Raghavan KL
>>
>>
>>  --
>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread payal gupta
@rahul ...
by my last line i meant that since we got to form a string of  6 chars with
the restriction that awrote:

> @payalplz explain how to slect 3 spaces for a.b.c out of 6.
> we need to put them in orderso look my aboyve post and plz comment
>
>
> On Sat, Oct 27, 2012 at 8:14 PM, rahul sharma wrote:
>
>> plz help mei am thinking this the following way..
>>
>> we need to find no. of permutaions of abcxyz s.t a>  means we need to form string of 6 length s.t a>
>> means we have 6 places
>> a- can be placed at 4/6 locations
>> b- can be palced at 4/6 locations
>> c-can be placed at 4/6 locations
>>
>> can we do like this?
>>
>>
>> On Sat, Oct 27, 2012 at 8:04 PM, rahul sharma wrote:
>>
>>>  ..i under stand with 6!/(3!*3!) method...
>>> plz explain from combination point of viewi didnt get ur last
>>> linei understand that
>>>
>>> we need to find no. of permutaions of abcxyz s.t a>> tell how to find thisi understand as someone explained above with
>>> VVVHHH method.
>>> please explain from thsi view that
>>>
>>> we need to find no. of permutaions of abcxyz s.t a>>
>>>
>>> On Sat, Oct 27, 2012 at 12:31 PM, Saurabh Kumar wrote:
>>>
>>>> Since this is a small grid you can count it manually but in general
>>>> problem is to count no. of paths from bottom-left corner to top-right
>>>> corner (provided all the transition alphabets in the automata are distinct
>>>> in the respective dimensions e.g. here,  xyz in one  dimension and abc in
>>>> other)
>>>>
>>>> You can view this problem as writing all permutations of strings of
>>>> 3R's and 3U's (for RIGHT movement and UP movement) RRRUUU which will take
>>>> you to the top right most corner.
>>>> All possible arrangements = (3+3)! / (3! * 3!)
>>>> In general: (m+n)! / (m! * n!) for a mxn grid.
>>>>
>>>>
>>>> On 27 October 2012 11:05, rahul sharma  wrote:
>>>>
>>>>> should i take it how many ways are there to reach from start to  the
>>>>> top right destination...x,y,z,a,b,c, are i/p statexyzabc one
>>>>> stringabc xyz is another...if m ryt then is dere any formulla to 
>>>>> calute
>>>>> or we have to do it manuall
>>>>>
>>>>>
>>>>> On Sat, Oct 27, 2012 at 11:02 AM, rahul sharma <
>>>>> rahul23111...@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> can u please elaborate...i am not able to understand the figure..plz
>>>>>> explainit would be of great help
>>>>>>
>>>>>> On Sat, Oct 27, 2012 at 5:57 AM, payal gupta wrote:
>>>>>>
>>>>>>> should be 6C3 or 20 perhaps.
>>>>>>>
>>>>>>> On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma <
>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Finite state automata accpt string of length 6
>>>>>>>>
>>>>>>>> what is total number of strings in set..please find the attahcment
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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 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@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.
>>>>>>>
>>>>>>
>>>>>>
>>>>>  -

Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-27 Thread payal gupta
it jst the pnc involved here
Clearrly, every string here is formed out a,b,c,x ,y z . if we notice here
'a' always occurs before 'b' which occurs after 'c' in any string that
would be generated by the fsm here. Same holds for the combination x ,y ,z .
So basically it reduces to a problem in which we have to form string with
above mentioned conditions being satisfied .
Since its a 6 letter string so select any 3 spaces for chars a,b,c and
place them  abc in order in the rest 3 spaces place xyz in order .

On Sat, Oct 27, 2012 at 11:05 AM, rahul sharma wrote:

> should i take it how many ways are there to reach from start to  the top
> right destination...x,y,z,a,b,c, are i/p statexyzabc one stringabc
> xyz is another...if m ryt then is dere any formulla to calute or we have to
> do it manuall
>
>
> On Sat, Oct 27, 2012 at 11:02 AM, rahul sharma wrote:
>
>>
>> can u please elaborate...i am not able to understand the figure..plz
>> explain....it would be of great help
>>
>> On Sat, Oct 27, 2012 at 5:57 AM, payal gupta  wrote:
>>
>>> should be 6C3 or 20 perhaps.
>>>
>>> On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma 
>>> wrote:
>>>
>>>> Finite state automata accpt string of length 6
>>>>
>>>> what is total number of strings in set..please find the attahcment
>>>>
>>>> --
>>>> 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 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@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 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 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@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.



Re: [algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta

 Sorry ,posted the wrong question initially actually i needed the algo for 
this question. Thanx.

On Saturday, October 27, 2012 7:04:10 AM UTC+5:30, raghavan wrote:
>
> By any chance did you read the new blog post by Gayle Laakmaan.. 
>
> I guess to detect typos we can use some sort of Trie implementation..
>
>
> On Fri, Oct 26, 2012 at 7:50 PM, payal gupta 
> > wrote:
>
>>   
>>Given a cube with sides length n, write code to print all possible 
>> paths from the center to the surface.
>>Thanx in advance.
>>
>>
>>Regards,
>>   PAYAL GUPTA,
>>   NIT-B.
>>
>> 
>>
>> -- 
>> 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/-/ZaItRf_9A_IJ.
>>
>> To post to this group, send email to algo...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> algogeeks+...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> -- 
> Thanks and Regards,
> Raghavan KL
>
>
>  

-- 
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/-/vVmz5r1gpIYJ.
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.



[algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta
  
   Given a cube with sides length n, write code to print all possible paths 
from the center to the surface.
   Thanx in advance.

   Regards,
  PAYAL GUPTA,
  NIT-B.



-- 
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/-/ZaItRf_9A_IJ.
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.



[algogeeks] INTERVIEW QUESTION

2012-10-26 Thread payal gupta

  Design the data structures and algorithms to detect typos in a document 
and then provide suggestions to the user.
   Thanx in advance,

  Regards,
  PAYAL GUPTA,
  NIT-B.

   

-- 
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/-/Y_OwlNJ_9f4J.
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.



Re: [algogeeks] BIG O

2012-10-26 Thread payal gupta
That 's correct.

On Sat, Oct 27, 2012 at 3:25 AM, rahul sharma wrote:

> for k=1 to n
> {
> j=k;
> while(j>0)
> j=j/2;
> }
> the complexity is big o is o(nlogn)
> am i ryt
>
> --
> 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 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@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.



Re: [algogeeks] Finite state automata accpt string of length 6

2012-10-26 Thread payal gupta
should be 6C3 or 20 perhaps.

On Sat, Oct 27, 2012 at 3:29 AM, rahul sharma wrote:

> Finite state automata accpt string of length 6
>
> what is total number of strings in set..please find the attahcment
>
> --
> 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 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@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.



Re: [algogeeks] Fwd: IVY comptech campus visit

2012-10-25 Thread payal gupta
One coding question : find the third largest no in the given array of
elements (20 min)
15 mcqs on java and apti each
followed by a tech and hr intervw.
@ll d bst..:):)

Regards,
PAYAL GUPTA,
NIT-B.

On Thu, Oct 25, 2012 at 2:13 PM, sachin singh  wrote:

> Can anyone tell about the selection proceedure for IVY comptech? I have
> heard they have visited NIT Bhopal. Please reply back with the questions
> that were asked in the written exam,
>
>  --
> 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 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@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.



[algogeeks] REARRANGE

2012-09-10 Thread payal gupta
A square picture is cut into 16 squares and they are shuffled. Write a 
program to rearrange the 16 squares to get the original big square.  

-- 
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/-/6RPKkORPwakJ.
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.



[algogeeks] INTRVIEW QUESTION

2012-08-11 Thread payal gupta
Given the start and an ending integer as user input, generate all integers 
with the following property. 
Example : 123 , 1+2 = 3 , valid number
121224 12+12 = 24 , valid number
1235 1+2 = 3 , 2+3 = 5 , valid number
125 1+2 <5 , invalid number 

-- 
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/-/zeZVnoP0sOEJ.
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.



Re: [algogeeks] merging

2012-08-05 Thread payal gupta
i guess dis shud wrk...
void merge(int arr[],int i,int k)
{
if(i==1)
{
arr[1]=arr[k];
arr[2]=arr[2*k];
return;
}
int a=arr[i-1];
int b=arr[2*i-1];
int c=arr[3*i-1];
merge(arr,i-1,n-3);
int t=(k-3);
arr[t]=a;
arr[t+1]=b;
arr[t+2]=c;
}

On Mon, Aug 6, 2012 at 1:05 AM, adarsh kumar  wrote:

> Cos, if they are stored as a vector of strings like a1, b1, etc. then u
> can use insertion sort like technique.
> Insert bi and ci between ai and a(i+1), for i=1,2,3n.
> This can be done simply by modifyin insertion  sort code. Pl let me know
> in case of any flaw! cos it seems to be so simple this way.
>
> On Mon, Aug 6, 2012 at 1:02 AM, adarsh kumar  wrote:
>
>> vector*
>>
>>
>> On Mon, Aug 6, 2012 at 1:02 AM, adarsh kumar  wrote:
>>
>>>
>>> Can you care to explain as to how exactly the elements are stored? Is it
>>> a vactor of strings??
>>>
>>> On Mon, Aug 6, 2012 at 12:32 AM, Navin Kumar 
>>> wrote:
>>>
>>>> Actually i wanted to do it inplace. Using extra space it is much
>>>> easier problem.
>>>>
>>>>
>>>> On Mon, Aug 6, 2012 at 12:27 AM, payal gupta wrote:
>>>>
>>>>> int merge(int arr[],int n)
>>>>> {
>>>>> int l=0;
>>>>> int j=(n/3);
>>>>> int k=2*(n/3);
>>>>> int *a=(int*)malloc(sizeof(int)*n);
>>>>> for(int i=0;i>>>> {
>>>>> a[l++]=arr[i];
>>>>> a[l++]=arr[j++];
>>>>> a[l++]=arr[k++];
>>>>> }
>>>>> for(int i=0;i>>>> arr[i]=a[i];
>>>>> free(a);
>>>>> }
>>>>> cud be dun be dun recursively also to minimize d space complexity...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Aug 4, 2012 at 8:20 AM, Navin Kumar 
>>>>> wrote:
>>>>>
>>>>>> In given array of elements like 
>>>>>> [a1,a2,a3,..an,b1,b2,b3,..bn,c**1,c2,c3,...cn]
>>>>>> .Write an efficient program to merge them like
>>>>>> [a1,b1,c1,a2,b2,c2,...an,bn,cn**].
>>>>>>
>>>>>> --
>>>>>> 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/-/gVCyxQV1IhAJ.
>>>>>> 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.
>>>>>>
>>>>>
>>>>>  --
>>>>> 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 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@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 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 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@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.



Re: [algogeeks] merging

2012-08-05 Thread payal gupta
int merge(int arr[],int n)
{
int l=0;
int j=(n/3);
int k=2*(n/3);
int *a=(int*)malloc(sizeof(int)*n);
for(int i=0;iwrote:

> In given array of elements like [a1,a2,a3,..an,b1,b2,b3,..bn,c**1,c2,c3,...cn]
> .Write an efficient program to merge them like
> [a1,b1,c1,a2,b2,c2,...an,bn,cn**].
>
> --
> 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/-/gVCyxQV1IhAJ.
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Local Minima in Unsorted Array

2012-08-05 Thread payal gupta
this could help although not true for many cases as said above

http://ideone.com/w5gjK


On Sun, Aug 5, 2012 at 8:40 AM, Ashish Goel  wrote:

> can you give an example of what do you mean by "Local" minima?
> From Dave's example, it looks like the minima of the whole array..
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Fri, Aug 3, 2012 at 10:32 PM, shady  wrote:
>
>> Hi,
>> Can anyone tell how to find local minima in an unsorted array ?
>> Recommended solution : O(log(n))
>>
>> Shady.
>>
>> --
>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] longest continuous sequence

2012-08-05 Thread payal gupta
Find the longest
subarray which consists of numbers that can be arranged in a continuous 
sequence.
For ex- {4,5,1,5,7,6,8,4,1}
output-{5,7,6,8,4}.Find the longest. 

-- 
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/-/MuACHn8S8vUJ.
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.



Re: [algogeeks] heap insertion

2012-07-26 Thread payal gupta
ans:4

On Thu, Jul 26, 2012 at 11:26 PM, Ali Ahmad Ansari <
ali.ahamad.ans...@gmail.com> wrote:

> Insert the numbers in the sequence "8, 5, 1, 4, 2, 10, 12, 7, 3" into a
> min-heap. The order of insertion is as given. The insertion happens as
> described here
> .
>
> If the root is said to be at level 1, the root's children at level 2, and
> so on, what is the level in which 8 occurs in the heap?
>
> · a. 1
>
> · b. 2
>
> · c. 3
>
> · d. 4
>
> · e. 5
>
> --
> 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/-/lfNrsE_muCAJ.
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Java recursion Question !!

2012-07-26 Thread payal gupta
perhaps its this quoted line...

" permu(c,i+1,j); "  >"permu(c,i+1,n)

On Thu, Jul 26, 2012 at 9:37 PM, teja bala wrote:

> // plz anyone tell me whats wrong in this code
> //o/p should print all possible permutations of string.
>
> class swap
> {
>  char ab[]={'a','b','c'};
>  public static void main(String[] args)
> {
> swap c=new swap();
>  permu(c.ab,0,3);
> }
> public static void permu(char c[],int i,int n)
>  {
> System.out.print(i);int j;
> if(i==n){ for( char ch:c)System.out.print(ch);}
>  else
> {
> for(j=i;j  {
> swaps(c[i],c[j]);
> permu(c,i+1,j);
>  swaps(c[i],c[j]);
> }
>  }
> }
> public static void swaps (char x,char y)
>  {
> char temp1=x;
> x=y;
>  y=temp1;
> }
> }
>
>  --
> 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 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@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.



Re: [algogeeks] program

2012-07-26 Thread payal gupta
ans.20

On Thu, Jul 26, 2012 at 11:09 PM, Ali Ahmad Ansari <
ali.ahamad.ans...@gmail.com> wrote:

> Given a number N, generate a sequence S such that
> S[ 0 ] = N
> S[ i+1 ] = (3 * S[ i ] + 1) / 2 if S[ i ] is odd,
> = S[ i ] / 2, if S[ i ] is even,
> till you reach 1.
> For example for N = 5, the sequence is 5, 8, 4, 2, 1
> Given two numbers 20 and 35, generate the sequence S for A
> and B, and find the number where the two sequences meet.
> a.20
> b.30
> c.35
> d.40
>
> --
> 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/-/EEhTdWZgDrQJ.
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] find the submatrix with largest sum

2012-07-14 Thread payal gupta
@atul..thnx 4 d link..

On 7/13/12, atul anand  wrote:
> this question was discussed beforecheck solution i had posted..
> link :-
> https://groups.google.com/group/algogeeks/browse_thread/thread/91a17f7c78c2319e/991d1c2625a62ff0?hl=en&lnk=gst&q=rectangle+of+max+sum+MS+Q#
>
>
>
> On Fri, Jul 13, 2012 at 6:30 PM, payal gupta  wrote:
>
>> given a n*n matrix of positive and negative integers ,find the submatrix
>> with the largest sum
>>
>> --
>> 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/-/4V_eLYu5KA0J.
>> 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.
>>
>
> --
> 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 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@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.



[algogeeks] find the submatrix with largest sum

2012-07-13 Thread payal gupta
given a n*n matrix of positive and negative integers ,find the submatrix 
with the largest sum

-- 
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/-/4V_eLYu5KA0J.
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.



Re: [algogeeks] Directi Interview Ques

2012-07-13 Thread payal gupta
i guess this algo would work...
1.scan the two array "a" and "b" from the end
say the indexs be i & j respectively for the two arrays
2.compare the elements a[i]  with b[j]
 if a[i]b[j]
  then include a[i] & j--
  else if recursively findin reducing which index would serve better
 {
  consider the case   a[]={1,2,3,3,3,4} ,b[]={3,3,3,6,7,8 };
 when coming to index i=4  and j=2 educing j is beneficial
}
iterate through step 2 until one of the array ends.and then include the
remaining elements of the other non empty array





On Fri, Jul 13, 2012 at 1:35 AM, sumit991  wrote:

> how would you solve it then
>
> On Wednesday, July 11, 2012 2:53:26 AM UTC+5:30, Mr.B wrote:
>
>> I think you missed the question:
>> Its a stable merge. (order of elements in each array should be same)
>> Sorting will destroy the original order.
>>
>> Thanks,
>> Mr.B
>> [Please include complexities and pseudo-code]
>>
>> On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote:
>>>
>>> Here you have to first sort both the arrays A and B and merge both the
>>> arrays to form the sorted array C
>>>
>>> --
>>>
>>>
>>> Akshat Sapra
>>> Under Graduation(B.Tech)
>>> IIIT-Allahabad(Amethi Campus)
>>> *--*
>>> sapraaks...@gmail.com
>>> akshatsapr...@gmail.com
>>> rit20009008@ iiita.ac.in
>>>
>>  --
> 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/-/mBt7Y0hzUL0J.
>
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: seperate diff types of coins

2012-07-10 Thread payal gupta
@ Dave sir
 the balance considered here is simple balance scale incapable of
giving any numeric reading and the we are unaware of any relationship
between x,y,a,b or any kind denominations prioirity in terms of
weights...
@navin..
"3 of them weigh x" means 3 of the coins individually weigh x gms,it
isnt the cumulative sum of the coins as u considered ,thats what i got
from the question..
Correct me if i'm wrong.
Could it  be done it done in lesser than 8 weighings??

Regards,
PAYAL GUPTA.

On 7/10/12, Dave  wrote:
> @Gupta: You haven't defined the problem sufficiently.
>
> What type of scale do we have, a balance scale or one that gives a numeric
> reading?
>
> Do we know x, y, a, and b, or are you just saying that one set of three
> coins weigh the same, another set of three also weigh the same but have
> different weight that the first set, and the remaining two weigh different
> amounts than each other and the two sets?
>
> Is there any known relationship between x, y, a, and b? We can assume
> without loss of generality that x < y and a < b, but what about the
> relationships between x and a, x and b, y and a, and y and b? Knowing more
> will allow a solution with fewer weighings than knowing less.
>
> Dave
>
> On Tuesday, July 10, 2012 12:33:47 AM UTC-5, payal gupta wrote:
>
>> You have 8 coins. 3 of them weigh x units, 3 y units, 1 a units and 1 b
>> units. They are all mixed and look identical. What are the minimum no of
>> weighings reqd to seperate the for types of coins???
>>
>
> --
> 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/-/c41Sw3CqNz4J.
> 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.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] seperate diff types of coins

2012-07-10 Thread payal gupta
@navin...Sorry didnt get you how come u were able to segregate all the
coins by the proposed method??


On 7/10/12, Navin Kumar  wrote:
> Minimum no. weighings:
>
> Divide 8 coins in group of 3, 3 and 2.
>
> For minimum weighsing group1 's total weight is x units(say) -->FIrst
> weighing
> Groups 2nd total weights is y units > Second weighing.
> Lastly one more weighing among a unit and b unit coins.--->3 rd weighing
>
>
> So minimum 3 weighing is required.
>
>
>
> On Tue, Jul 10, 2012 at 11:03 AM, payal gupta  wrote:
>
>> You have 8 coins. 3 of them weigh x units, 3 y units, 1 a units and 1 b
>> units. They are all mixed and look identical. What are the minimum no of
>> weighings reqd to seperate the for types of coins???
>>
>> --
>> 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/-/HhIaN4zgpxMJ.
>> 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.
>>
>
> --
> 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 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@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.



[algogeeks] seperate diff types of coins

2012-07-09 Thread payal gupta


You have 8 coins. 3 of them weigh x units, 3 y units, 1 a units and 1 b 
units. They are all mixed and look identical. What are the minimum no of 
weighings reqd to seperate the for types of coins???

-- 
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/-/HhIaN4zgpxMJ.
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.



Re: [algogeeks] MS Design Ques

2012-07-05 Thread payal gupta
thnx...4 d rply..

Regards,
PAYAL GUPTA,
NIT-B.

On Fri, Jul 6, 2012 at 12:43 AM, Anshu Mishra wrote:

> First define all the basic operation you can apply on two numbers.
>
> Binary operation : +, -, *, /, %, optional(&(and), |(or), ^(xor))
> Unary operation : !, ~, -
> Comparison : <, > ==, !=
>
> Define all these operation.
>
> Most simplest one can be,
> class BIG_INT {
>private string val;
>//Define constructor
>private BIG_INT(){}
>public BIG_INT(int x) {
>this.val = x.toString();
>}
>public BIG_INT(long x) {
>this.val = x.toString();
>}
>public BIG_INT(string x) {
>this.val = x;
>}
>public BIG_INT add(BIG_INT x);
>public BIG_INT add(int x);
>public BIG_INT add(long x);
>
>   similarly write methods for other operation also;
>
>   }
>
> If this question asked for only design testing purpose only all method
> declaration will be sufficient.
>
> --
> Anshuman Mishra | Software Development Engineer | Amazon
>
>
>  --
> 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 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@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.



[algogeeks] MS Design Ques

2012-07-01 Thread payal gupta
design a BIG_INT library...

Regards,
PAYAL GUPTA,
NIT-B.

-- 
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/-/EHIiPPFJ4t0J.
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.



Re: [algogeeks] Re: Partition the array with equal average

2012-05-19 Thread payal gupta
@abhijeet  how could partitioning the array elements into two parts with
half the total sum each help, if the no. of elements in the two parts be
unequal resulting into unequal average?

On Sun, May 20, 2012 at 1:11 AM, abhijeet srivastva <
nwaab.abhij...@gmail.com> wrote:

> This is a subset sum problem. You have to find a subset of elements of
> array whose sum is x/2, where x is sum of all the elements of the array.
>
>
> On Sat, May 19, 2012 at 2:07 PM, payal gupta  wrote:
>
>> this wont work out as we need to partition the elements to get the
>> average of the two parts to be equal and not the sum of the two parts..
>>
>>
>> On Fri, May 18, 2012 at 11:57 PM, Ramindar Singh wrote:
>>
>>> Not sure if i am correct but still be very close.
>>>
>>> 1. Intial Array is A with n elements
>>> 2. Sort the Array's in descending order
>>> 3. take 2 more arrays B and C in which u keep the partition
>>> 4. pull the one element from A to B and keep keep track of the sum's in
>>> both the arrays B & C
>>> 5. Try to reach the sum in B by pulling the elements from A
>>> 6. Continue till all the n elements are partitioned.
>>> 7. If in the end still some difference is there b/w B and C, it can be
>>> settled by exchanging the elements among them as they both would be sorted.
>>>
>>> hope this helps...
>>>
>>> --
>>> 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/-/BRRM2sjulSEJ.
>>>
>>> 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.
>>>
>>
>>  --
>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Partition the array with equal average

2012-05-19 Thread payal gupta
this wont work out as we need to partition the elements to get the average
of the two parts to be equal and not the sum of the two parts..

On Fri, May 18, 2012 at 11:57 PM, Ramindar Singh  wrote:

> Not sure if i am correct but still be very close.
>
> 1. Intial Array is A with n elements
> 2. Sort the Array's in descending order
> 3. take 2 more arrays B and C in which u keep the partition
> 4. pull the one element from A to B and keep keep track of the sum's in
> both the arrays B & C
> 5. Try to reach the sum in B by pulling the elements from A
> 6. Continue till all the n elements are partitioned.
> 7. If in the end still some difference is there b/w B and C, it can be
> settled by exchanging the elements among them as they both would be sorted.
>
> hope this helps...
>
> --
> 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/-/BRRM2sjulSEJ.
>
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Partition the array with equal average

2012-05-18 Thread payal gupta
ignore my last post ...
Thnx for the suggestions..

On Sat, May 19, 2012 at 10:29 AM, payal gupta  wrote:

> @adarsh why have we taken an assumption of the average to be integer all
> the time it  could be float as well?
> @prem how could we find all possible subsets in tc-O(n2) as it will
> clearly be exponential...
>
>
> On Sat, May 19, 2012 at 8:58 AM, Gene  wrote:
>
>> We discussed this some time ago.  It's NP hard.  So an algorithm that
>> gets the correct answer every time will run in exponential time.  You
>> can do it in pseudo-polynomial time -- polynomial in the magnitude of
>> the elements - by using the DP method used for subset sum.
>>
>> On May 18, 2:35 am, payal gupta  wrote:
>> >  How do you partition an array into 2 parts such that the two parts have
>> > equal average?...each partition may contain elements that are
>> > non-contiguous in the 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
>> algogeeks+unsubscr...@googlegroups.com.
>> 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@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.



Re: [algogeeks] Re: Partition the array with equal average

2012-05-18 Thread payal gupta
@adarsh why have we taken an assumption of the average to be integer all
the time it  could be float as well?
@prem how could we find all possible subsets in tc-O(n2) as it will clearly
be exponential...

On Sat, May 19, 2012 at 8:58 AM, Gene  wrote:

> We discussed this some time ago.  It's NP hard.  So an algorithm that
> gets the correct answer every time will run in exponential time.  You
> can do it in pseudo-polynomial time -- polynomial in the magnitude of
> the elements - by using the DP method used for subset sum.
>
> On May 18, 2:35 am, payal gupta  wrote:
> >  How do you partition an array into 2 parts such that the two parts have
> > equal average?...each partition may contain elements that are
> > non-contiguous in the 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
> algogeeks+unsubscr...@googlegroups.com.
> 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@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.



[algogeeks] Partition the array with equal average

2012-05-17 Thread payal gupta
 How do you partition an array into 2 parts such that the two parts have 
equal average?...each partition may contain elements that are 
non-contiguous in the array...

-- 
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/-/fSAXqe-gkJcJ.
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.



Re: [algogeeks] Interview Question based on histogram

2012-05-17 Thread payal gupta
//A <-area of the cell of histogram
// volarr[] <-holds the vol of water already present at particular index
void fn(int index,int volpoured)
{
int vcapacity=A*heightarr[index];
if(volpoured+volarr[index]vcapacity)
{
volpoured-=vcapacity-volarr[index];
volarr[index]=vcapacity;
// if the height of the adjacent left and right columns are both less then
equal amt of water overflows on either sides
if(heightarr[index-1]<=heightarr[index] &&
heightarr[index+1]<=heightarr[index])
{
fn(index+1,volpoured/2);
fn(index-1,volpoured/2);
}
//if the left column has height greater and left has lesser then entire amt
flows to left
else if(heightarr[index-1]>heightarr[index] &&
heightarr[index+1]<=heightarr[index]&& index!=n-1)
fn(index+1,volpoured);
//if the right column has height lesser and right has height greater then
entire amt flows to right
else if(heightarr[index+1]>heightarr[index] &&
heightarr[index-1]<=heightarr[index] && index!=0)
fn(index-1,volpoured);
//if both left and right have height greater then water overflows at the
same index
else
{
printf("overflow occurs at index %d\n",index);
return;
}
}
// sum of the all elemnts of  volarr[] gives the water trapped

On Fri, May 18, 2012 at 10:36 AM, Prem Krishna Chettri
wrote:

> Algo Dear.. Algo.. implementation Anyone can Do..
>
> Req ppl to share their own algo.. No Someones Code Implementation..
>
> On Fri, May 18, 2012 at 9:54 AM, payal gupta  wrote:
>
>> hope this works..
>> http://ideone.com/XSJRJ
>>
>>
>> On Fri, May 18, 2012 at 8:20 AM, Bhaskar Kushwaha <
>> bhaskar.kushwaha2...@gmail.com> wrote:
>>
>>> It depends on which column you are pouring the water.
>>> For example
>>> If you choose the shortest column to pour the water then only that
>>> column will be filled with water.
>>>
>>> Please correct me if I am wrong.
>>>
>>>
>>> On Thu, May 17, 2012 at 11:27 AM, Nikhil Agarwal <
>>> nikhil.bhoja...@gmail.com> wrote:
>>>
>>>> Imagine that you have an histogram stored in an array. Now imagine that
>>>> you can pour water on top of your histogram. Describe an algorithm that
>>>> computes the amount of water that remains trapped among the columns of the
>>>> graph. Clearly on the edges the water would fall off. Use the language or
>>>> the pseudocode you prefer.
>>>>
>>>> --
>>>> Thanks & Regards
>>>> Nikhil Agarwal
>>>> B.Tech. in Computer Science & Engineering
>>>> National Institute Of Technology, Durgapur,India
>>>> http://tech-nikk.blogspot.com
>>>> http://beta.freshersworld.com/communities/nitd
>>>>
>>>>
>>>>  --
>>>> 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 group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> regards,
>>> Bhaskar Kushwaha
>>> Student
>>> CSE
>>> Third year
>>> M.N.N.I.T.  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+unsubscr...@googlegroups.com.
>>> 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@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 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 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@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.



Re: [algogeeks] Interview Question based on histogram

2012-05-17 Thread payal gupta
hope this works..
http://ideone.com/XSJRJ

On Fri, May 18, 2012 at 8:20 AM, Bhaskar Kushwaha <
bhaskar.kushwaha2...@gmail.com> wrote:

> It depends on which column you are pouring the water.
> For example
> If you choose the shortest column to pour the water then only that column
> will be filled with water.
>
> Please correct me if I am wrong.
>
>
> On Thu, May 17, 2012 at 11:27 AM, Nikhil Agarwal <
> nikhil.bhoja...@gmail.com> wrote:
>
>> Imagine that you have an histogram stored in an array. Now imagine that
>> you can pour water on top of your histogram. Describe an algorithm that
>> computes the amount of water that remains trapped among the columns of the
>> graph. Clearly on the edges the water would fall off. Use the language or
>> the pseudocode you prefer.
>>
>> --
>> Thanks & Regards
>> Nikhil Agarwal
>> B.Tech. in Computer Science & Engineering
>> National Institute Of Technology, Durgapur,India
>> http://tech-nikk.blogspot.com
>> http://beta.freshersworld.com/communities/nitd
>>
>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> regards,
> Bhaskar Kushwaha
> Student
> CSE
> Third year
> M.N.N.I.T.  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+unsubscr...@googlegroups.com.
> 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@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.



Re: [algogeeks] Re: finding anagrams in a list of words

2012-05-14 Thread payal gupta
hmm...
thnx for the catch of my flaw...

On Mon, May 14, 2012 at 11:56 PM, saurabh singh wrote:

> u mean ad == bc ?
>
>
> On Mon, May 14, 2012 at 10:41 PM, payal gupta  wrote:
>
>> @atul
>> instead of sorting the string individually which would require tc-
>> O(nlogn) shouldnot it be a better idea to use the sum of the ascii values
>> of the individual alphabets as the key which would require tc-O(n) ???
>>
>>
>>
>> On Sun, May 13, 2012 at 7:07 PM, GAURAV CHAWLA 
>> wrote:
>>
>>> @deepikaanand:
>>>
>>>
>>> 1 is not a prime no. and also ignore 2 as chosen prime no,.
>>>
>>> On Sun, May 13, 2012 at 6:31 PM, deepikaanand 
>>> wrote:
>>>
>>>>
>>>> @gaurav
>>>> the approach suggested as : to have an array of 25 prime nos..How is
>>>> it supposed to work ;
>>>> cz(this is wat i have understood) if a :0 ,b:1,c:3,d:5,e:7
>>>> then be = b + e = 1+7 =8
>>>> and  dc = d + c =5 +3 = 8..
>>>>
>>>> --
>>>> 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 group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> Regards,
>>> GAURAV CHAWLA
>>> +919992635751
>>> +919654127192
>>>
>>>
>>>
>>>
>>>  --
>>> 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 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@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.
>>
>
>
>
> --
> Thanks & Regards,
> Saurabh
>
>  --
> 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 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@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.



Re: [algogeeks] Re: finding anagrams in a list of words

2012-05-14 Thread payal gupta
@atul
instead of sorting the string individually which would require tc- O(nlogn)
shouldnot it be a better idea to use the sum of the ascii values of the
individual alphabets as the key which would require tc-O(n) ???


On Sun, May 13, 2012 at 7:07 PM, GAURAV CHAWLA wrote:

> @deepikaanand:
>
>
> 1 is not a prime no. and also ignore 2 as chosen prime no,.
>
> On Sun, May 13, 2012 at 6:31 PM, deepikaanand wrote:
>
>>
>> @gaurav
>> the approach suggested as : to have an array of 25 prime nos..How is
>> it supposed to work ;
>> cz(this is wat i have understood) if a :0 ,b:1,c:3,d:5,e:7
>> then be = b + e = 1+7 =8
>> and  dc = d + c =5 +3 = 8..
>>
>> --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Regards,
> GAURAV CHAWLA
> +919992635751
> +919654127192
>
>
>
>
>  --
> 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 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@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.



Re: [algogeeks] Re: find a point closest to other points

2012-04-25 Thread payal gupta
We can calculate the centroid of all d points and then calculate their
individual distances from it .The point with the minimum distance will
be the answer.
TC :O(n)

Regards,
PAYAL GUPTA

On 4/25/12, Navneet  wrote:
> We cannot do it without computing distances of each node from all other
> nodes. So to begin with, construct a matrix representation of the graph
> with distances filled in for every pair of points.
>
> Proceed to calculate the minimum spanning tree of such a weighted graph.
> Kruskal's and Prim's are two well known algorithms to do that. Such a point
> should lie on this spanning tree.
>
> Not very sure how to quickly find the desired point on MST, but problem
> becomes easier with MST.
>
>
> On Wednesday, 25 April 2012 11:10:38 UTC+5:30, tech coder wrote:
>>
>> Given N points(in 2D) with x and y coordinates. You have to find a
>> point P (in N given points) such that the sum of distances from
>> other(N-1) points to P is minimum.
>>
>> --
>>
>>  Regards
>> "The Coder"
>>
>>
>
> --
> 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/-/rJZk24xBTqYJ.
> 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.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] [ DirectI ] Interview question

2012-03-24 Thread payal gupta
the o/p for the array  { 1 ,6 ,8 ,3 ,5, 4, 2}  is:

2 6 8 3 5 4 1
1 3 8 6 5 4 2
1 3 6 8 5 4 2
1 3 6 5 8 4 2
1 3 6 5 4 8 2
1 3 6 5 4 2 8
not necessarily the sorted array...

On Sun, Mar 25, 2012 at 1:04 AM, shady  wrote:

> what is the output for this ?
>  { 1 ,6 ,8 ,3 ,5, 4, 2}
>
> On Sat, Mar 24, 2012 at 7:31 PM, Navin Kumar wrote:
>
>> Given an array of integers, for each index i, you have to swap the value
>> at i with the first value smaller than A[ i ] that comes after index i.
>> An efficient solution expected.
>>
>>  --
>> 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/-/an6YzWV-2xsJ.
>> 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.
>>
>
>  --
> 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 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@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.



Re: [algogeeks] [ DirectI ] Interview question

2012-03-24 Thread payal gupta
if the array considered is  { 1 ,6 ,8 ,3 ,5, 4, 2} is this the way the
problm o/p expected???

1 6 8 3 5 4 2
1 3 8 6 5 4 2
1 3 6 8 5 4 2
1 3 6 5 8 4 2
1 3 6 5 4 8 2
1 3 6 5 4 2 8
correct if wrong.

On Sat, Mar 24, 2012 at 10:53 PM, karthikeyan muthu <
keyankarthi1...@gmail.com> wrote:

> if i'm not wrong .. we are to repeat this process till no more such pair
> is found.. rite?? this condition will come only if the given array gets
> sorted in ascending order .. so the solution is to sort the array
> O(nlogn)..
>
>
>
> On Sat, Mar 24, 2012 at 7:31 PM, Navin Kumar wrote:
>
>> Given an array of integers, for each index i, you have to swap the value
>> at i with the first value smaller than A[ i ] that comes after index i.
>> An efficient solution expected.
>>
>>  --
>> 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/-/an6YzWV-2xsJ.
>> 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.
>>
>
>  --
> 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 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@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.



Re: [algogeeks] Array problem

2012-03-12 Thread payal gupta
@atul...
if its the sum of the elements to the left of a[i] which are smaller the my
approach works w/o any flaw
here's the working code for ithttp://ideone.com/CH7VW
if its the sum of all elements lesser than the element a[i] then this algo
is surely wrong
n we then have to proceed by the avl trees or some height balanced tree n
the algo would be of TC-O(nlogn)
btw nyc catch thnx...

Regards,
PAYAL GUPTA


On Mon, Mar 12, 2012 at 5:19 PM, Piyush Kapoor  wrote:

> 1)First map the array numbers into the position in which they would be, if
> they are sorted,for example
> {30,50,10,60,77,88} ---> {2,3,1,4,5,6}
> 2)Now for each number ,find the cumulative frequency of index ( = the
> corresponding number in the map - 1).
> 3)Output the cumulative frequency and increase the frequency  at the
> position (=the corresponding number in the map) by the number itself.
> Example
> {3,5,1,6,7,8}  Map of which would be {2,3,1,4,5,6}
> Process the numbers now,
> 1)3 comes ,find the cumulative frequency at index 1 ( = 2-1) which is 0.
> so output 0
>Increase the frequency at index 2 to the number 3.
> 2)5 comes,find the CF at index 2( = 3-1) which is equal to 3 .output 3.
>Increase the frequency at index 3 to the number 5.
> 3)1 comes,CF at index 0 (=1-1) = 0 so output 0.increase the F at position
> 1 by 1.
> Similarly for others.
>
>
>  --
> 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 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@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.



Re: [algogeeks] Array problem

2012-03-11 Thread payal gupta
 the algo vich i thought of is as follows-

struct node{
int data;
struct node *left,*right;
int lsum;   //for storing the leftsum
int k;// for storing the storing the reqd sum which is leftsum + sum of
the elements traversed till now on the path
};


Algo for insertion of nodes in bst->
1. add the new node with data as the value ,lsum set to 0 and k set to 0
2.continue adding further nodes and update the value of 'k' by the data to
be added  whenever value is added to theleft subtree of the node
3. on adding the node to the right of the root set the value of leftsum to
be summation of rootvalue+k of the nodes considered during traversal



   (3,0,0)
\
(5,3+0,0)

   (3,0,1)
/\
(1,0,0)(5,3+0,0)

   (3,0,1)
   / \
(1,0,0)  (5,3+0,0)
   \
   (6,1+5+3,0)

(3,0,1)
/ \
 (1,0,0)   (5,3+0,0)
 \
 (6,1+5+3,0)
   \
   (7,1+5+3+6,0)

(3,0,1)
/ \
(1,0,0)  (5,3+0,0)
\
(6,1+5+3,0)
  \
  (7,1+3+5+6,0)
\
(8,3+1+5+6+7,0)


where the node-(data,leftsum,k)






On Sun, Mar 11, 2012 at 7:06 PM, sanjiv yadav wrote:

> u r right payal but
> can u expln o(n) time complexity..
>
>
> On Sun, Mar 11, 2012 at 6:10 PM, payal gupta  wrote:
>
>> By Augmented BST-
>> TC-O(n)
>>
>>
>> On Sun, Mar 11, 2012 at 3:08 PM, Gaurav Popli wrote:
>>
>>> given an array of size n...
>>> create an array of size n such that ai where ai is the element in the
>>> new array at index location i is equal to sum of all elements in
>>> original array which are smaller than element at posn i...
>>>
>>> e.g
>>> ar[]={3,5,1,6,7,8};
>>>
>>> ar1[]={0,3,0,9,15,22};
>>>
>>> --
>>> 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 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@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.
>>
>
>
>
> --
> Regards
>
> Sanjiv Yadav
>
> MobNo.-  8050142693
>
> Email Id-  sanjiv2009...@gmail.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more 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@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.



Re: [algogeeks] Array problem

2012-03-11 Thread payal gupta
By Augmented BST-
TC-O(n)

On Sun, Mar 11, 2012 at 3:08 PM, Gaurav Popli wrote:

> given an array of size n...
> create an array of size n such that ai where ai is the element in the
> new array at index location i is equal to sum of all elements in
> original array which are smaller than element at posn i...
>
> e.g
> ar[]={3,5,1,6,7,8};
>
> ar1[]={0,3,0,9,15,22};
>
> --
> 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 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@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.



Re: [algogeeks] Re: find longest common contiguous intersection from 2 lists

2012-03-10 Thread payal gupta
first of all ,its not suffix array bt suffix tree..vich i mistyped...sorry
4 dat..n
yeah!!! d question demands the samebt d same question cud also b solved
by suffix trees the implementation of vich i require as there is some flaw
in ma implementation...
so ,i vud b thankful if ny has shares dat.
Regards,
PAYAL GUPTA


On Sat, Mar 10, 2012 at 10:12 AM, Sonia Keys  wrote:

> This?  http://en.wikipedia.org/wiki/Longest_common_substring_problem
>
> On Friday, March 9, 2012 2:30:57 PM UTC-5, payal gupta wrote:
>>
>>
>> find the efficient implementation to find longest common contiguous
>> intersection from 2 lists provided to the function.
>> Example: list1: abcrfghwetf
>> list2: abrfghwwetxyab
>>
>> Longest common intersection here is: rfghw
>>
>> need the suffix array implementation in c...
>> thnx..in advance!!
>>
>>
>>
>>
>>
>>
>>
>  --
> 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/-/k9wuU0jTB4QJ.
>
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] find longest common contiguous intersection from 2 lists

2012-03-09 Thread payal gupta


find the efficient implementation to find longest common contiguous 
intersection from 2 lists provided to the function.
Example: list1: abcrfghwetf
list2: abrfghwwetxyab

Longest common intersection here is: rfghw

need the suffix array implementation in c...
thnx..in advance!!





  

-- 
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/-/crQiMe5F9lwJ.
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.



Re: [algogeeks] Puzzle

2012-02-28 Thread payal gupta
one option cud be reverse the digits...i.e
(bt the first n d last do not satisfy d pattern howeva)
93 , 14,34,54,94,15,35,35,55
an increment is applied to the last 4th no each tme...
not very sure if its crckt...

Regards,
PAYAL GUPTA



On Tue, Feb 28, 2012 at 12:48 PM, Kartik Sachan wrote:

> I think logic is the difference is
> 2 2 4 2 2 2 8 so next will be 2 2  2 2 2 16
>
> so ans will be 66 68 70
>
>
> but first number 3 making some problem
>
>  --
> 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 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@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.



Re: [algogeeks] Finding closest double in a Btree

2012-02-20 Thread payal gupta
here is the soln.
http://ideone.com/Qu0a0#view_edit_box

however dere's a problem which needs to be resolved
the prob is if the diff is 0 then due to the use of abs() its getting
overriden
i'm not able to find way out of it...
ny suggestns are welcum..

Regards,
PAYAL GUPTA.

On Mon, Feb 20, 2012 at 4:54 PM, Supraja Jayakumar  wrote:

> Hi
>
> Question is given a binary tree and a key K, code to find the node with
> the closest value.
>
> I'd be happy to receive some feedback about my solution too.
>
> Pls find the code below:
>
> class FindingClosestNodeInTree {
> private static double difference = 0.0;
> private static doule key = 0.0;
> int main() {
> BinaryTree bt;
> bt.insert(20.43);
> bt.insert(12.78);
> bt.insert(19.89);
> bt.insert(32.69);
> bt.insert(2.54);
> cout << "Please provide the key value" << endl;
> cin >> key;
> const Node &closestNode = closestValue(bt);
> cout << << "Node that has the closest value to " <<  <<
> closestNode.value;
> return 1;
> }
> const Node & closestValue(const BinaryTree &node) {
> if(node==null)
> return;
>
> int val = node.value;
> int currDiff = val > key ? val-key:key-val;
> difference = currDiff > difference ? currDiff:difference;
> if(node.left!=null)
> closestValue(node.left);
> if(node.right!=null)
> closestValue(node.right);
> return difference;
> }
> }
>
> Thanks
> Supraja J
>
> --
> 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 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@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.



Re: [algogeeks] determining if frequency is greater than n/2

2012-02-09 Thread payal gupta
i dont think its possible for unsorted array in O(logn)..

Regards,
PAYAL GUPTA ,
NIT-B

On Thu, Feb 9, 2012 at 6:02 PM, atul anand  wrote:

> @payal : this will work for only sorted array  not for unsorted.
>
>
> On Thu, Feb 9, 2012 at 5:50 PM, payal gupta  wrote:
>
>> http://www.geeksforgeeks.org/archives/4722
>> O(logn) soln...
>>
>> Regards,
>> PAYAL GUPTA,
>> NIT-B
>>
>>
>> On Thu, Feb 9, 2012 at 5:33 PM, atul anand wrote:
>>
>>> ignore my comment...
>>>
>>>
>>> On Thu, Feb 9, 2012 at 4:15 PM, Ashish Goel  wrote:
>>>
>>>> log n is impossible. the other solution i thought was of building a
>>>> tree where each node contains value and its count. and then building a heap
>>>> out of these counts, but this will be overkill.
>>>>
>>>> the fact that rest of the n/2 elements are not unique is the killer in
>>>> the logic otherwise only n/2+1 elements are sufficient
>>>>
>>>> Best Regards
>>>> Ashish Goel
>>>> "Think positive and find fuel in failure"
>>>> +919985813081
>>>> +919966006652
>>>>
>>>>
>>>>
>>>> On Thu, Feb 9, 2012 at 2:53 PM, atul anand wrote:
>>>>
>>>>> i guess can be done using binary indexed tree.
>>>>>
>>>>>
>>>>> On Thu, Feb 9, 2012 at 2:07 PM, Prakhar Jain wrote:
>>>>>
>>>>>> But in this post, we don't have prior information about what can be
>>>>>> possible majority element.
>>>>>>
>>>>>> According to my question, we know that either x is the majority
>>>>>> element or there is no majority element.
>>>>>> Can we use that information to reduce complexity to O(log 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 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 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 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@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 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 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@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 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 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@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.



Re: [algogeeks] determining if frequency is greater than n/2

2012-02-09 Thread payal gupta
http://www.geeksforgeeks.org/archives/4722
O(logn) soln...

Regards,
PAYAL GUPTA,
NIT-B

On Thu, Feb 9, 2012 at 5:33 PM, atul anand  wrote:

> ignore my comment...
>
>
> On Thu, Feb 9, 2012 at 4:15 PM, Ashish Goel  wrote:
>
>> log n is impossible. the other solution i thought was of building a tree
>> where each node contains value and its count. and then building a heap out
>> of these counts, but this will be overkill.
>>
>> the fact that rest of the n/2 elements are not unique is the killer in
>> the logic otherwise only n/2+1 elements are sufficient
>>
>> Best Regards
>> Ashish Goel
>> "Think positive and find fuel in failure"
>> +919985813081
>> +919966006652
>>
>>
>>
>> On Thu, Feb 9, 2012 at 2:53 PM, atul anand wrote:
>>
>>> i guess can be done using binary indexed tree.
>>>
>>>
>>> On Thu, Feb 9, 2012 at 2:07 PM, Prakhar Jain wrote:
>>>
>>>> But in this post, we don't have prior information about what can be
>>>> possible majority element.
>>>>
>>>> According to my question, we know that either x is the majority element
>>>> or there is no majority element.
>>>> Can we use that information to reduce complexity to O(log 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 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 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 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@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 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 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@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.



Re: [algogeeks] In a char string, find min distance between 2 letters, O(n) time, O(1) space.

2012-02-05 Thread payal gupta
do u mean d min distance b/w two specific nos present in an array which may
have repeated ele's???
Regards,
PAYAL GUPTA,
NIT-B.

On Sun, Feb 5, 2012 at 7:51 PM, Ashish Goel  wrote:

>
>
>
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
> --
> 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 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@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.



Re: [algogeeks] c output

2012-01-16 Thread payal gupta
i gues atul is crkt.
its jst printin by user convenience...when actually d two are not equal...

i guess the code...xplains well...dats y "equal " is not printed..out


#includeint main(){
   double p=fabs(24.9996);
   printf("%lf\n",p);
   double t=fabs(25.0003);
   printf("%lf\n",t);
   printf("%0.3lf %0.3lf\n",p,t);
   printf("%lf\n%lf\n",fabs(p),fabs(t));
   if(fabs(p)==fabs(t))
   printf("equal");// why this not executed?}


crkt me if i'm wrong..
Regards,
PAYAL GUPTA,
NIT-BHOPAL..
On Tue, Jan 17, 2012 at 12:13 PM, shady  wrote:

> atul he is assigning the value later on.
> i think format specifier . rounds up the number in last decimal place.
>
>
> On Tue, Jan 17, 2012 at 11:53 AM, atul anand wrote:
>
>> printf("%0.3lf %0.3lf\n",p,t);
>>
>> its just printing at your convenience . you are not changing the value of
>> p,t .
>> change this statement to
>> printf("%0.5lf %0.5lf\n",p,t);
>>
>>
>>
>>
>> On Tue, Jan 17, 2012 at 11:27 AM, dabbcomputers 
>> wrote:
>>
>>> #include
>>> int main()
>>> {
>>>double p=fabs(24.9996);
>>>double t=fabs(25.0003);
>>>printf("%0.3lf %0.3lf\n",p,t);
>>>if(fabs(p)==fabs(t))
>>>printf("equal");// why this not executed?
>>> }
>>>
>>>
>>> why the "equal" not printed in this 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 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@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 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 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@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.



Re: [algogeeks] Linked list MS Q

2012-01-14 Thread payal gupta
sorry 4 d error in last post..
dis link vud b helpful..if not known previously...

http://www.geeksforgeeks.org/archives/12367

Regards,
PAYAL GUPTA,
NIT-BHOPAL.

On Sat, Jan 14, 2012 at 7:29 PM, payal gupta  wrote:

> XOR linked lists...
> dis willbe
>
> On Sat, Jan 14, 2012 at 7:13 PM, Ankur Garg  wrote:
>
>> XOR Linked Lists
>> helpful if not known..
>>
> http://www.geeksforgeeks.org/archives/12367
>
> Regards,
> PAYAL GUPTA,
> NIT-BHOPAL.
>
>>
>> On Sat, Jan 14, 2012 at 7:06 PM, Ashish Goel  wrote:
>>
>>> design a linked list that has only one pointer per node yet can be
>>> traversed in forward or reverse direction.
>>>
>>>
>>> Best Regards
>>> Ashish Goel
>>> "Think positive and find fuel in failure"
>>> +919985813081
>>> +919966006652
>>>
>>> --
>>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Linked list MS Q

2012-01-14 Thread payal gupta
XOR linked lists...
dis willbe

On Sat, Jan 14, 2012 at 7:13 PM, Ankur Garg  wrote:

> XOR Linked Lists
> helpful if not known..
>
http://www.geeksforgeeks.org/archives/12367

Regards,
PAYAL GUPTA,
NIT-BHOPAL.

>
> On Sat, Jan 14, 2012 at 7:06 PM, Ashish Goel  wrote:
>
>> design a linked list that has only one pointer per node yet can be
>> traversed in forward or reverse direction.
>>
>>
>> Best Regards
>> Ashish Goel
>> "Think positive and find fuel in failure"
>> +919985813081
>> +919966006652
>>
>> --
>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] prob

2012-01-14 Thread payal gupta
hi...i gues u getting confused vth d last character o/p 4m d last
printf...so i guess dat i'll be cleared..if u jst modify ur test
string..

chk dis out
main()
{
char ch[]="ABCP";
char *s;
s=ch;
printf("%c",*s++);
printf("%c",*++s);
printf("%c",++*s);
}
 d last printf isnt printin d D vich is d last character bt d value after
incrementin wen d pointer still points 2 d charactr "C" in string...
hope i was clear @ xplainatn...

Regards,
PAYAL GUPTA,
NIT-BHOPAL.


On Sat, Jan 14, 2012 at 3:10 PM, om prakash yadav <
ompraksyadav123...@gmail.com> wrote:

> main()
> {
> char ch[]="ABCD";
> char *s;
> s=ch;
> printf("%c",*s++);
> printf("%c",*++s);
> printf("%c",++*s);
> }
>
> Can anyone plz tell me the concept behind output??
>
> --
> 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 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@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.



Re: [algogeeks] MS Question

2012-01-14 Thread payal gupta
@himanshu thnx..:)

Regards,
PAYAL GUPTA,
3rd YR ,CSE,
NIT-BHOPAL.

On Fri, Jan 13, 2012 at 9:42 PM, Himanshu Neema <
potential.himansh...@gmail.com> wrote:

> Let a color below represent a single character in UTF-8 encoding ,
> which means that each color can span multiple bytes , In example below I
> denote one byte by one english character . i.e.
> 'a' or 'b' or 'c'  ,etc.  below takes one byte :
>
> Let the string is :
> x abc def gh ij klmn
> now to reverse this UTF-8 encoded string in place in two steps :
> 1) reverse bytes of a multibyte character in place ,
> after this step the string will look like :
> x cba fed hg ji nmlk
> 2) Now apply a normal string reversal algo , i.e , to swap first byte with
> last byte , swap second byte to second last byte .. and so on ...
> after this step the string will look like :
> klmn ij gh def abc x
>
> And look we have reversed an UTF-8 encoded string in place :)
>
>
>
>
> On Fri, Jan 13, 2012 at 11:13 AM, Supraja Jayakumar <
> suprajasank...@gmail.com> wrote:
>
>> Hi
>>
>> Normal string will not work I think. Because it is avriable length
>> encoding scheme.
>>
>> On Fri, Jan 13, 2012 at 11:11 AM, b.kisha...@gmail.com <
>> b.kisha...@gmail.com> wrote:
>>
>>> Is there anything called in-place reversal ??
>>> UTF-8 is only encoding similar to ASCII but with a huge charecter set.
>>> So normal string reversal would work fine..
>>>
>>>
>>>
>>> On Thu, Jan 12, 2012 at 2:02 AM, Ankur Garg wrote:
>>>
>>>> How to do this
>>>>
>>>> Write a function to reverse a UTF-8 encoded string in-place ??
>>>>
>>>>
>>>>
>>>>  --
>>>> 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 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@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.
>>>
>>
>>
>>
>> --
>> U
>>
>> --
>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] C QUESTION???

2012-01-06 Thread payal gupta
@utkarsh n tejbala ...thnx..4 d info.

Regards,
Payal gupta,
3rd year,cse,
NIT-Bhopal


On Sat, Jan 7, 2012 at 9:30 AM, teja bala  wrote:

> ## concatenating operator
>
>
> On Sat, Jan 7, 2012 at 9:01 AM, UTKARSH SRIVASTAV  > wrote:
>
>> yes payal read a standard c book like dennis ritchie ... these are
>> the best source
>>
>>
>> On Sat, Jan 7, 2012 at 1:53 AM, payal gupta  wrote:
>>
>>> @parag thnx...
>>> btw is dere ny source dat has ny info bout it??
>>>
>>> Regards,
>>> Payal Gupta,
>>> 3rd year,
>>> NIT-Bhopal
>>>
>>>
>>> On Sat, Jan 7, 2012 at 12:36 AM, parag khanna 
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Jan 7, 2012 at 12:36 AM, parag khanna >>> > wrote:
>>>>
>>>>>
>>>>> it joins the variables together ... for eg 1##2 = 12 or a##b=ab
>>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Parag Khanna
>>>>> B.tech Final Year
>>>>> NIT,Kurukshetra*
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Parag Khanna
>>>> B.tech Final Year
>>>> NIT,Kurukshetra*
>>>>
>>>> --
>>>> 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 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@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.
>>>
>>
>>
>>
>> --
>> *UTKARSH SRIVASTAV
>> CSE-3
>> B-Tech 3rd Year
>> @MNNIT 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+unsubscr...@googlegroups.com.
>> 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] C QUESTION???

2012-01-06 Thread payal gupta
@parag thnx...
btw is dere ny source dat has ny info bout it??

Regards,
Payal Gupta,
3rd year,
NIT-Bhopal

On Sat, Jan 7, 2012 at 12:36 AM, parag khanna wrote:

>
>
> On Sat, Jan 7, 2012 at 12:36 AM, parag khanna wrote:
>
>>
>> it joins the variables together ... for eg 1##2 = 12 or a##b=ab
>>
>
>
>>
>>
>>
>>
>>
>> --
>> *Parag Khanna
>> B.tech Final Year
>> NIT,Kurukshetra*
>>
>
>
>
> --
> *Parag Khanna
> B.tech Final Year
> NIT,Kurukshetra*
>
> --
> 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 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@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.



[algogeeks] C QUESTION???

2012-01-06 Thread payal gupta
Wat is the use of ## in define??



#include 
#define f(g,g2) g##g2
void main()
{
int var12 =100;
printf("%d",f(var,12));

}

o/p :100


-- 
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/-/o1OhOAqADHgJ.
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.



Re: [algogeeks] Re: Questions

2011-12-05 Thread payal gupta
ya hashing cud be a bttr soln bt wat cud be hash fn den???

Regards,
PAYAL GUPTA.

On 11/30/11, Ankuj Gupta  wrote:
> We can do it by hashing. hash the 2-d array and then search for 1 d array
> in the hash table.
>
> --
> 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/-/7PE1mqG4RRgJ.
> 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.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-03 Thread payal gupta
@ atul n ankur...
thnx..for the info..

regards,
payal gupta

On 12/3/11, saurabh singh  wrote:
> First of all congrats Viharri.As far as I can remember most of the above
> questions has already been discussed on this group(If not directly in a
> different variation,)
> My request to the other members would be to maintain the relevance of this
> group.If you have any queries regarding the interview proceedure and stuff
> you can mail Viharri personally,Kindly maintain the motive of the group
> which is to share quality algo problems and discuss there soutions.
> On Sat, Dec 3, 2011 at 5:00 PM, Ankur Garg  wrote:
>
>> cWas it offcampus or on campus recruitment dude.
>>
>> On Sat, Dec 3, 2011 at 12:5i7 PM, atul anand
>> wrote:
>>
>>> @payal : last problem is a dutch flag problem.
>>>
>>>
>>> On Sat, Dec 3, 2011 at 3:33 AM, payal gupta  wrote:
>>>
>>>> congrats..:):)
>>>> plzz...elaborate the last two problemsand it vud be very grateful
>>>> if u tell their solns tooo...
>>>>
>>>> Regards,
>>>> payal gupta,cse,3rd year,
>>>> nit-b.
>>>>
>>>>
>>>> On 12/2/11, rahul sharma  wrote:
>>>> > plz post how you prepared for MS..like the books or websites you
>>>> > followedwould b of gr8 help.
>>>> >
>>>> > On Fri, Dec 2, 2011 at 9:42 PM, rahul sharma >>> >wrote:
>>>> >
>>>> >> gr8...congrats dude
>>>> >>
>>>> >>
>>>> >> On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B
>>>> >> wrote:
>>>> >>
>>>> >>> Congratulations:)
>>>> >>>
>>>> >>> --
>>>> >>> 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 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@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 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 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@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 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 at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT 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+unsubscr...@googlegroups.com.
> 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@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.



Re: [algogeeks] Thanks To aLgOgEeKs

2011-12-02 Thread payal gupta
congrats..:):)
plzz...elaborate the last two problemsand it vud be very grateful
if u tell their solns tooo...

Regards,
payal gupta,
cse,3rd year,
nit-b.


On 12/2/11, rahul sharma  wrote:
> plz post how you prepared for MS..like the books or websites you
> followedwould b of gr8 help.
>
> On Fri, Dec 2, 2011 at 9:42 PM, rahul sharma wrote:
>
>> gr8...congrats dude
>>
>>
>> On Fri, Dec 2, 2011 at 9:05 PM, Karthikeyan V.B
>> wrote:
>>
>>> Congratulations:)
>>>
>>> --
>>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Reconstruct BST from preorder traversal

2011-10-17 Thread payal gupta
hey,i guess a specific binary tree is not possible...by d use of jst a
preorder...
4 a specific tree inorder is also reqd...
dere will be many trees posible...sso is it dat v got 2 make all possible
tree vth d given preorder???


On Tue, Oct 18, 2011 at 10:12 AM, Ankuj Gupta  wrote:

> How to reconstruct a BST from just the prorder traversal of that 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, 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@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.



Re: [algogeeks] Re: MS test cases type Questions

2011-10-08 Thread payal gupta
k...
thanx...your info vud be of great help for me in future..

regards,
PAYAL GUPTA,
CSE 3RD YR
NIT_B


On Wed, Sep 14, 2011 at 11:38 PM, KK  wrote:

> U must mention all the boundary cases, very large input cases, -ve nos
> and must throw appropriate exception while coding during interviews...
> Questions are not too hard in MS... just they dont want buggy code...
> even if u allocate memory.. u should take an if condition i.e. if (p !
> = NULL)...and avoid such other silly mistakes...
>
> --
> 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 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@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.



Re: [algogeeks] Database Classes

2011-10-08 Thread payal gupta
thnxx...4 sharing..:):)

regards,
PAYAL GUPTA,
CSE_3rd yr
NIT_B


On Sat, Oct 8, 2011 at 7:47 PM, monty 1987 <1986mo...@gmail.com> wrote:

> Thanks A lot for sharing!!
>
> On Sat, Oct 8, 2011 at 2:03 PM, Rahul Verma wrote:
>
>> Hi friends,
>>
>> Sorry for this off topic, but I found that it would be interesting for us
>> that now we have online classes of Databases from Stannford.
>> db-class.org
>>
>> --
>> 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/-/zpcbKJ1elvMJ.
>> 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.
>>
>
>  --
> 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 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@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.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread payal gupta
had been finnding d buk since many daz..
plzzz..do send d buk 2 me 2...
thnx...in advance...:)

regards,
PAYAL GUPTA,
CSE-3rd YR
NIT_B

On Mon, Sep 26, 2011 at 4:03 PM, sangeeta goyal wrote:

> i also need that book
>
>
> On Mon, Sep 26, 2011 at 6:00 AM, Amit Mittal wrote:
>
>> plz send me that book too
>>
>>
>> On Mon, Sep 26, 2011 at 3:28 PM, Ishan Aggarwal <
>> ishan.aggarwal.1...@gmail.com> wrote:
>>
>>> plz send me that book to
>>> I also need that book...
>>>
>>>
>>> On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath >> > wrote:
>>>
>>>> hi every one..
>>>> pls do give me the link if u find or have, about this book..
>>>> title name:"Data Structures and Algorithms Made Easy: 700 Data
>>>> Structure and Algorithmic Puzzles"
>>>> author:"Narasimha Karumanchi"
>>>> ISBN-10: 145654988X
>>>> ISBN-13: 978-1456549886
>>>> publisher:careermonk..
>>>> pls do send to this email id..."prasathsar...@gmail.com"
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2.aggar...@aricent.com 
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more 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@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 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 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@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.



Re: [algogeeks] dbms

2011-09-23 Thread payal gupta
hmmm..yes dey r d theory...vich i used..n dey r gud

regards,
PAYAL GUPTA,
CSE_3rd yr
NIT_B

On Fri, Sep 23, 2011 at 11:21 PM, Akash Mukherjee wrote:

> @payal : thanx but des are more of theory books ryt??
>
> On Fri, Sep 23, 2011 at 5:32 PM, payal gupta  wrote:
>
>> KORTH OR NAVATHE  is nyc...:)
>>
>> regards,
>> PAYAL GUPTA,
>> CSE 3rd yr,
>> NIT_B
>>
>> On Fri, Sep 23, 2011 at 1:09 PM, Akash Mukherjee wrote:
>>
>>> hican ne1 suggest good books for dbms...not theory types but more of
>>> a question bank like maybe a cracking the coding interview is for
>>> coding/algo...
>>>
>>> thanx :)
>>>
>>> -
>>> 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 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@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 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 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@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.



Re: [algogeeks] dbms

2011-09-23 Thread payal gupta
KORTH OR NAVATHE  is nyc...:)

regards,
PAYAL GUPTA,
CSE 3rd yr,
NIT_B

On Fri, Sep 23, 2011 at 1:09 PM, Akash Mukherjee  wrote:

> hican ne1 suggest good books for dbms...not theory types but more of a
> question bank like maybe a cracking the coding interview is for
> coding/algo...
>
> thanx :)
>
> -
> 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 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@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.



Re: [algogeeks] Re: error in c++ program

2011-09-22 Thread payal gupta
#include

class time
{
int m;
int h;
public:
void set(int,int);
void sum(time,time,time);
void display();
};
void time::set(int x,int y)
{
m=x;
h=y;
}
void time::sum(time t1,time t2,time t3)
{
m=t1.m+t2.m+t3.m;
h=t1.h+t2.h+t3.h;
}
void time::display(void)
{
cout<<"minute=="< 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.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: What is the time to get min element from the binary max heap !!

2011-09-20 Thread payal gupta
its O(nlogn) only...
n v cant directly access d leaf element...
since d leaf elements are n(n-1)/2so last dese many elemnts will found n
compared...



Regards,
PAYAL GUPTA,
CSE-3rd yr
NIT_B

On Tue, Sep 20, 2011 at 10:54 PM, saurabh agrawal wrote:

> How will you directly access the leaf nodes, you dont have the heap
> implementation, you are just provided with the API. :)
>
>
>
> On Tue, Sep 20, 2011 at 9:55 PM, sukran dhawan wrote:
>
>> o(n)
>>
>>
>> On Tue, Sep 20, 2011 at 6:42 PM, CHERUVU JAANU REDDY <
>> jaanu.cher...@gmail.com> wrote:
>>
>>>
>>> We can find minimum element in O(n) time.
>>>
>>> Just compare leaf nodes in max heap tree.
>>>
>>>
>>>
>>> Cheers
>>> Janardhan Reddy Cheruvu
>>> +91-9642421117
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Sep 20, 2011 at 6:39 PM, saurabh agrawal 
>>> wrote:
>>>
>>>> I think, we have to delete all the elements from the heap which takes
>>>> o(n*logn). Please share if you have any better solutions.
>>>>
>>>> On Tue, Sep 20, 2011 at 6:38 PM, saurabh agrawal 
>>>> wrote:
>>>>
>>>>> What is the time to get min element from the binary max heap !!
>>>>> You might be given the heap as API. I mean, you dont have
>>>>> implementation of the heap.
>>>>>
>>>>
>>>>  --
>>>> 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 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@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 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: yahoo campus placements

2011-09-16 Thread payal gupta
do share u experiences..n questions if possible 4 sure!!!
thnx..in advance...

Regards,
PAYAL GUPTA,
CSE-3rd yr
NIT-B

On Fri, Sep 16, 2011 at 11:31 AM, siva viknesh wrote:

> http://in.careers.yahoo.com/students/content/186
>
> check this .. it has visited many colleges including trichy NIT ..
> contact them...kindly share ur experience after attending ...
>
> On Sep 15, 8:09 am, Akash Mukherjee  wrote:
> > k...bt its a gud 2 weeks lefti guess der wud be sm other clg visits
> b4
> > dat
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Sep 14, 2011 at 9:22 PM, htross  wrote:
> > > please share the questions asked after the company visits ur campus
> >
> > > On Sep 14, 8:53 pm, Akash Mukherjee  wrote:
> > > > bit mesra, cg 7...dunno nething else :(
> >
> > > > On Wed, Sep 14, 2011 at 3:00 PM, rahul sharma <
> rahul23111...@gmail.com
> > > >wrote:
> >
> > > > > in which col it is cumingn wats is its procedure???waht is cgpa
> > > > > creteria?
> >
> > > > > On Wed, Sep 14, 2011 at 6:26 PM, Akash Mukherjee <
> akash...@gmail.com
> > > >wrote:
> >
> > > > >> anybody has any yahoo campus placements papers/questions or tips
> etc.
> > > > >> please share
> >
> > > > >> thanx in advance
> >
> > > > >> Akash
> >
> > > > >> --
> > > > >> 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 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@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 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS test cases type Questions

2011-09-14 Thread payal gupta
dats f9...bt cud i get 2 knoe ...how bout answering 2 d perfectness...n  if
v cud practice dem from nywhere

Regards,
PAYAL GUPTA,
CSE-3 rd yr,
NIT-B

On Tue, Sep 13, 2011 at 10:05 PM, Navneet  wrote:

> Basically test cases are asked for very general purpose software like
> a Notepad etc.
>
> Generally they want you to come up with as many as test cases as
> possible.
>
>
> On Sep 13, 7:15 pm, Akash Mukherjee  wrote:
> > +1
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 12, 2011 at 3:42 PM, pg@manit  wrote:
> > > Cud some 1 suggest me 4m how 2 practise test cases type of questions
> > > which usually cum in MS written Papers?
> > > thanx..in advance
> >
> > > Regards,
> > > PAYAL 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] ms question

2011-09-12 Thread payal gupta
@piyush..
cud u plzz..xplain...n elaborate

Regards,

Payal Gupta

On Mon, Sep 12, 2011 at 10:15 PM, Piyush Grover
wrote:

> Sry i was little wrong:
>
> nC0*(1/n)^n + nC2 *2*(1/n)^n + nC4*2^2*(1/n)^n++nCn*2^(n/2)*(1/n)^n
> when n is even
>
> nC0*(1/n)^n + nC2 *2*(1/n)^n +
> nC4*2^2*(1/n)^n++nCn-1*2^(n-1/2)*(1/n)^n   when n is odd
>
>
> On Mon, Sep 12, 2011 at 10:08 PM, Piyush Grover  > wrote:
>
>> it should be:
>>
>> (1/n)^n * (1 + 2 + 2^2 + 2^3 +(n/2)+1 terms) = {2^(1 + n/2) -
>> 1}*(1/n)^n   when n even
>>
>> (1/n)^n * (1 + 2 + 2^2 + 2^3 +(n-1/2)+1 terms) = {2^(1 + (n-1)/2)  -
>> 1}*(1/n)^n   when n is odd
>>
>>
>> -Piyush
>>
>>
>> On Mon, Sep 12, 2011 at 8:01 PM, sandeep nagamalli 
>> wrote:
>>
>>> I think it is 1 / (2N)
>>>
>>> (1/N) * (1/N)*(N/2) = 1/(2N)
>>>
>>>
>>> On Mon, Sep 12, 2011 at 6:33 PM, Akash Mukherjee wrote:
>>>
>>>> this is a case, but isnt der a case of circular permutation 2??
>>>> what say abt dis
>>>> 0,1
>>>> 2,3
>>>> 4,5
>>>> 0,1
>>>> 2,3
>>>> 4,5
>>>>
>>>> it wrks i gues??
>>>>
>>>>
>>>> On Mon, Sep 12, 2011 at 12:56 PM, teja bala 
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> I think it is 1/N
>>>>>
>>>>>  let N=6 that means rand(6)= takes values 0-5 i.e 6 values.
>>>>> rand(m)=6 values
>>>>> rand(n)=6 values
>>>>> total combinations 6*6=36 values set but among dem array will change
>>>>> only for
>>>>> (0,0)(1,1)(2,2)(3,3)(4,4)(5,5)(6,6)=6values of N
>>>>>
>>>>> So 6/36=1/6
>>>>>
>>>>> If we generalize it 1/N
>>>>>
>>>>> correct me if i'm wrong?
>>>>>
>>>>> --
>>>>> 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 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@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.
>>>>
>>>
>>>
>>>
>>> --
>>> Thanks&Regards:
>>> -sandeep
>>>
>>>
>>>  --
>>> 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] need help

2011-09-12 Thread payal gupta
+1 techcoder,plzzz mail me 2..thanks in advance
Regards,
Payal Gupta


On Mon, Sep 12, 2011 at 11:01 AM, sukran dhawan wrote:

> +1 to tech coder
>
> On Mon, Sep 12, 2011 at 10:50 AM, tech coder wrote:
>
>> if somebody has the preparation material  and videos provided by
>> Careercup.com. Then please send me.
>> thanks.
>>
>> --
>> tech codYou 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 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@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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Puzzle

2011-08-18 Thread payal gupta
was there anything more specified
Regards,
PAYAL GUPTA

On Fri, Aug 19, 2011 at 3:29 AM, Aditya Virmani wrote:

> If ü - Married
> û - Not Married and
> M-ü N-û
> N-ü L-û
> L-û M-ü
> Who is married?
>
> qn was put up in this way, asked in Deloitte 2004.
>
> --
> 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 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@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.



Re: [algogeeks] Adobe off campus event

2011-08-18 Thread payal gupta
+1 siddharam
plzz...inform any off campus...if any1 has any idea..

Regards,
PAYAL GUPTA.

On Thu, Aug 18, 2011 at 11:27 PM, siddharam suresh
wrote:

> guys please keep updating about any off campus event
> Thank you,
> Siddharam
>
>
>
> On Thu, Aug 18, 2011 at 10:28 PM, rubal singh wrote:
>
>> Is Adobe open now for offcampus recruitment??
>>
>> Regards
>> Rubal Singh
>>
>> On Thu, Aug 18, 2011 at 5:11 PM, anon  wrote:
>> > Has anyone recently appeared for Adobe off campus event?  The profile
>> > is C/C++ programming as MTS. It is for 1 yr experienced or more
>> > candidates.
>> > Any pointers for its preparation are welcome :)
>> >
>> > --
>> > 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 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@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 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 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@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.



Re: [algogeeks] Re: MS BRAINTEASR

2011-08-18 Thread payal gupta
hmm...suitable rply i suppose
thanx...:):)

REGARDS,
PAYAL GUPTA


On Thu, Aug 18, 2011 at 4:36 PM, DheerajSharma
wrote:

> it would take c days to take off all the hats
>
> On Aug 18, 3:51 pm, "pg@manit"  wrote:
> > A bunch of men are on an island. A genie comes down and gathers
> > everyone together and places a magical hat on some people’s heads
> > (i.e., at least one person has a hat). The hat is magical: it can be
> > seen by other people, but not by the wearer of the hat himself. To
> > remove the hat, those (and only those who have a hat) must dunk
> > themselves underwater at exactly midnight. If there are n people and c
> > hats, how long does it take the men to remove the hats? The men cannot
> > tell each other (in any way) that they have a hat.
> > FOLLOW UP
> > Prove that your 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 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 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 at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Urgent...plz help

2011-08-18 Thread payal gupta
i agree with amol
it cud be max-heap only...

Regards,
PAYAL GUPTA

On Thu, Aug 18, 2011 at 2:26 PM, Apoorve Mohan wrote:

> or rather u can just have 100 iterations of selection sort...u'll get the
> min 100 iterations...and this is inplace as well...
>
>
> On Thu, Aug 18, 2011 at 1:18 PM, Apoorve Mohan wrote:
>
>> Create a B+ tree and extract the first 100 leaf nodes
>>
>> On Thu, Aug 18, 2011 at 1:05 PM, Ankur Garg  wrote:
>>
>>> U can use selection Algorithm to achieve the same ...it has got expected
>>> running time complexity as O(n) ...Read Wikipedia to see the proper
>>> implementation..
>>>
>>> Just some tweak with Quick Sort ..Also there is one method median of
>>> medians one which has worst case complexity as O(n)
>>>
>>> Regards
>>>
>>> Ankur
>>>
>>>
>>> On Wed, Aug 17, 2011 at 11:47 PM, Amol Sharma wrote:
>>>
>>>> it will be max heap only.in which root denotes the largest number in
>>>> your set of 100 smallest
>>>> --
>>>>
>>>>
>>>> Amol Sharma
>>>> Third Year Student
>>>> Computer Science and Engineering
>>>> MNNIT Allahabad
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Aug 18, 2011 at 9:14 AM, aditi garg 
>>>> wrote:
>>>>
>>>>> @ dave : i hv one doubt,we wud be maintaining a max or a min heap??
>>>>>
>>>>>
>>>>> On Thu, Aug 18, 2011 at 9:11 AM, aditi garg >>>> > wrote:
>>>>>
>>>>>> thank u so much dave :)
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 18, 2011 at 8:44 AM, Dave wrote:
>>>>>>
>>>>>>> @Aditi: Form a max-heap of the first 100 numbers. Then as you read
>>>>>>> the
>>>>>>> remaining numbers, if a number is less than the root of the max-heap,
>>>>>>> replace the root with it and restore the heap condition. When you
>>>>>>> reach the end of the million numbers, the heap will contain the
>>>>>>> smallest 100 numbers.
>>>>>>>
>>>>>>> If there are n numbers and you want the smallest k, this algorithm is
>>>>>>> O(n log k).
>>>>>>>
>>>>>>> Dave
>>>>>>>
>>>>>>> On Aug 17, 10:05 pm, aditi garg  wrote:
>>>>>>> > How to find the set of smallest 100 numbers out of 1 million
>>>>>>> numbers...
>>>>>>>
>>>>>>> --
>>>>>>> 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 group at
>>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Aditi Garg
>>>>>> Undergraduate Student
>>>>>> Electronics & Communication Divison
>>>>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>>>>> Sector 3, Dwarka
>>>>>> New Delhi
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Aditi Garg
>>>>> Undergraduate Student
>>>>> Electronics & Communication Divison
>>>>> NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
>>>>> Sector 3, Dwarka
>>>>> New Delhi
>>>>>
>>>>>
>>>>>  --
>>>>> 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 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@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 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 at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> regards
>>
>> Apoorve Mohan
>>
>>
>
>
> --
> regards
>
> Apoorve Mohan
>
>  --
> 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 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@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.



Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread payal gupta
ys...i guess i misinterpreted..the question..
ma fault...

On Thu, Aug 18, 2011 at 4:27 AM, Brijesh Upadhyay <
brijeshupadhyay...@gmail.com> wrote:

> At the node from where the loop just started.. anyway we could not use that
> logic , coz it isnt circular linked list!
>
> --
> 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/-/sr4w-kPmnEsJ.
>
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Output?? Why??

2011-08-17 Thread payal gupta
i modified the code a lil bit
#include
#include
int main()
{ clrscr();
 char arr[5] = "geeks";
 printf("%s\n", arr);
 char b[1]="t";
 printf("%s\n",b);
 getchar();
 return 0;
}

the output in dis case is somewhat diff..cud someone explain...

On Thu, Aug 18, 2011 at 3:28 AM, Ayush Kapoor wrote:

> There is no null character in this string,as its length is 5 and the number
> of characters is 5(Geeks),and printf("%s",arr) should output the string till
> the null character
>
>
> On Thu, Aug 18, 2011 at 2:40 AM, bihari  wrote:
>
>> upto null 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
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Ayush
>
>  --
> 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 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@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.



Re: [algogeeks] Amazon Interview Q

2011-08-17 Thread payal gupta
if we take 2 pointers initialized with the start node with one moving in
forward direction and other in backward direction and execute until both
point to same node .it cud be workin faster i suppose...

On Thu, Aug 18, 2011 at 1:21 AM, Piyush Sinha wrote:

> We all knw hw to find a loop in a singly linked list (Using hare and
> tortoise method)..what if the linked list is a doubly linked list?can
> we do it smthn better than hare n tortoise method using the advantage
> of the doubly linked list?
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-7483122727*
> *  "NEVER SAY
> NEVER"
> *
>
> --
> 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 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@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.



Re: [algogeeks] Re: Microsoft Written Test Questions

2011-08-10 Thread payal gupta
do reply if u have it

On Thu, Aug 11, 2011 at 12:24 AM, Brijesh Upadhyay <
brijeshupadhyay...@gmail.com> wrote:

> Yeah...please share questions..it will be of a lot help!
>
> --
> 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/-/cs4XYfgJrooJ.
>
> 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.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.