hey! the solution can be found by summation from 1 to n + 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
mine approach is log(n)
check it out first
On Thu, Aug 25, 2011 at 1:21 AM, Don dondod...@gmail.com wrote:
I'm going to assume that elements in pairs means exactly two of each
element except for the one which is missing it's pair.
The recursive solution is simple, but it only uses tail
@ankur:
i think its error..l value required
On Wed, Aug 24, 2011 at 11:18 PM, Ankur Garg ankurga...@gmail.com wrote:
Hi
Suppose there is a program
int main(){
printf(%t,main());
sleep(1000);
return 0;
}
The above program is run from 100 different windows
What will be the
in brief,
in the next pointer put the XOR value of previous and next block address.
when you want to access the previous node just do the XOR operation with
next block address
and for next node do the XOR operation with previous block address.
it will require an extra variable to maintain either
On Aug 24, 11:41 pm, Arun Vishwanathan aaron.nar...@gmail.com wrote:
@don: so if a 16bit value is put into a 32 bit field and i need to read the
value, do i need to read last 16 bits only somehow ?
As long as you are saving those 16 bits in a variable (an integer, a
bit-field or
I dont think it will be error, U r passing main function as reference so it
will print some address ..
The only concern is when u execute this 100 or more times will there be some
pattern in the answer ?
Regards
Ankur
On Thu, Aug 25, 2011 at 1:41 AM, prasanth n nprasnt...@gmail.com wrote:
Using getchar() after the first scanf ll be much better...!!
--
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
it might cause STACK OVERFLOW for larger size of lists.
On Thu, Aug 25, 2011 at 2:04 AM, Abhishek mailatabhishekgu...@gmail.comwrote:
in brief,
in the next pointer put the XOR value of previous and next block address.
when you want to access the previous node just do the XOR operation with
How to find the distance of a node from the root of the tree??
Give algorithm.
--
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/-/hL50R3KOgGgJ.
To post to this
Hi,
We can do like this,
int computeXY(Tnode *root,int x,int y)
{
if(root==NULL)
return x;
root-y=y;
int l=computeXY(root-left,x,y-1);
root-x=l+1;
int r=computeXY(root-right,root-x,y-1);
return r;
}
call it as,
computeXY(root,-1,getHeight(root,0)-1);
Thanks
I assume that elements in pairs means that each value occurs exactly
twice except for the one single.
This algorithm is O(log n) and is nonrecursive. Writing it recursively
would make it a couple of lines shorter, but because it is purely tail
recursion, that is not necessary.
// Given an array a
http://en.wikipedia.org/wiki/XOR_linked_list
Check this...will be handy
On Thu, Aug 25, 2011 at 2:12 AM, Mohit kumar lal kumarmohit...@gmail.comwrote:
it might cause STACK OVERFLOW for larger size of lists.
On Thu, Aug 25, 2011 at 2:04 AM, Abhishek
mailatabhishekgu...@gmail.comwrote:
in
int getDistance(Tnode *root,Tnode *node,int dist)
{
if(root==NULL)
return 0;
if(root==node)
return dist;
return
getDistance(root-left,node,dist+1)|getDistance(root-right,node,dist+1);
}
Thanks Regards,
Anantha Krishnan
On Thu, Aug 25, 2011 at 2:30 AM, rohit
well it means when you move right you add +1 to column and when you move
left you add -1, you can do this by using linked list.
On Wed, Aug 24, 2011 at 9:31 PM, Nikhil Veliath nve...@gmail.com wrote:
find vertical sum of a binary tree . . . wat do we mean by vertical sum
-- Forwarded
how about using a trie 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
Do you mean even O(1) isn't good?
On Wed, Aug 24, 2011 at 8:43 PM, UMESH KUMAR kumar.umesh...@gmail.com wrote:
Qn. Remove all duplicates words from given a line without using extra memory
?
Ex:-Hello word hello hi
Out put:- Hello word hi
--
You received this message because you are
XOR all the elements, the answer is the number you want.
On Aug 24, 5:11 pm, Don dondod...@gmail.com wrote:
I assume that elements in pairs means that each value occurs exactly
twice except for the one single.
This algorithm is O(log n) and is nonrecursive. Writing it recursively
would make
@don : can you please share some link for NTL ???
@dave i am unable to understand what you mean ... this is because since
these are very large numbers i can never save them as integers in ints or
longs , so how ??
On Wed, Aug 24, 2011 at 11:57 PM, Debabrata Das
debabrata.barunhal...@gmail.com
how about suffix tree?
On Thu, Aug 25, 2011 at 4:22 AM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:
Do you mean even O(1) isn't good?
On Wed, Aug 24, 2011 at 8:43 PM, UMESH KUMAR kumar.umesh...@gmail.com
wrote:
Qn. Remove all duplicates words from given a line without using extra
@Shailesh: Sir, your response is unresponsive, because the original
poster specifically asked for a solution that was O(n). Please don't
waste our time giving answers that so obviously do not meet the
problem statement.
Dave
On Aug 24, 6:33 pm, smb shaileshbir...@gmail.com wrote:
XOR all the
On Thu, Aug 25, 2011 at 2:04 AM, Ninad Page ninad1...@gmail.com wrote:
If you stick to one convention its not that difficult to code without
bothering about endian's.In your case if you want to have a variable data
size for int(As far as I can guess),develop ur own integer interface using
raw
@Mac: Regarding your question to Don: Did you try google before you
asked? If not, why not?
Regarding your question to me: The basic unit of numbers are digits.
You may not have realized it, but when you were in elementary school
you learned how to represent numbers as arrays of digits, and how
@Sagar: And how do you use hashing without extra memory? Please,
please, please read the question, and don't bother to reply if you
can't answer it?
Dave
On Aug 24, 11:10 am, sagar pareek sagarpar...@gmail.com wrote:
use hashing
On Wed, Aug 24, 2011 at 8:43 PM, UMESH KUMAR
Dave: are you not too much rude here ? yes it is one's responsibility to
read the question but it is equally important to be humble . Same things can
be answered and asked in different tones. Just try to maintain yours.
Yours truly,
A fellow brainstorm-er .
On Thu, Aug 25, 2011 at 8:21 AM, Dave
C-Dot procedure (For Computers):
- First shortlist on the basis of cgpa/ %age for interviews.
- Only one round of interview, based on your resume. Discussion of projects
and questions related to mainly OS, Networking and Programming.
There is nothing as selection of Toppers only. If you are good
@Ankur Garg: Please explain to me how my method uses extra memory?
--
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
well i got 85 % in that. Its lil tricky test u need to clear ur geometry
skills for quant and prepare DI properly for logical portion.
On Thu, Aug 25, 2011 at 9:49 AM, prasanna rockslife2...@gmail.com wrote:
Hi
Whosoever have taken the elitmus test, pls share the type of questions
asked in
i guss CAT se bhi zyada diff hai Elitmus.
On Thu, Aug 25, 2011 at 12:56 AM, Khyati Gupta khyatigupt...@gmail.comwrote:
Any body has sample paper of E-lithmus
On Thu, Aug 25, 2011 at 12:17 AM, Abhishek Sharma
jkabhishe...@gmail.comwrote:
similar to CAT though the level is little low... no
pls enlighten us with the questions asked in elitmus(if anyone could
remember).
On Aug 25, 9:30 am, ROHIT SINGHAL rohitksingha...@gmail.com wrote:
i guss CAT se bhi zyada diff hai Elitmus.
On Thu, Aug 25, 2011 at 12:56 AM, Khyati Gupta khyatigupt...@gmail.comwrote:
Any body has
thanks rohit.
pls mentions some of the questions asked.
On Aug 25, 9:29 am, ROHIT SINGHAL rohitksingha...@gmail.com wrote:
well i got 85 % in that. Its lil tricky test u need to clear ur geometry
skills for quant and prepare DI properly for logical portion.
On Thu, Aug 25, 2011 at 9:49 AM,
Most commonly used algo to detect a loop in a linked list is to have two
pointers running, one at double the speed of other and check if they
meet..What is the time complexity of this algorithm?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
O(n)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
@Anup: your method wont use extra memory.
your solution is correct. But i think we can find better soultion.
Duplicate means Not only it occured 2 times, it may be 2,3 4..etc..
so we have to consider that also. In that case complexity will go like
O(N^2) ,
N= number of words in line
Thanks
101 - 133 of 133 matches
Mail list logo