* The Ball Puzzle
*How can you throw a ball as hard as you can and have it come back to you,
even if it doesn't bounce off anything? There is nothing attached to it, and
no one else catches or throws it back to you.
Update Your Answers at : Click
when u throw it above u.
On Wed, Apr 6, 2011 at 1:16 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:
* The Ball Puzzle
*How can you throw a ball as hard as you can and have it come back to you,
even if it doesn't bounce off anything? There is nothing attached to it, and
no one else
throw opposite to gravity...
Regards,
Akash Agrawal
http://tech-queries.blogspot.com/
On Wed, Apr 6, 2011 at 1:26 PM, balaji a peshwa.bal...@gmail.com wrote:
when u throw it above u.
On Wed, Apr 6, 2011 at 1:16 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:
* The Ball Puzzle
*How can
hi ,
i've recently joined this group in a mood to master the algorithms.
Will someone tell ,weather i will be benifitted by this group or not.
???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Yes
On 6 April 2011 11:36, a_SillyGuy ammukumar...@gmail.com wrote:
hi ,
i've recently joined this group in a mood to master the algorithms.
Will someone tell ,weather i will be benifitted by this group or not.
???
--
You received this message because you are subscribed to the Google
toughest puzzle ever :P
On Wed, Apr 6, 2011 at 1:27 PM, Akash Agrawal akash.agrawa...@gmail.comwrote:
throw opposite to gravity...
Regards,
Akash Agrawal
http://tech-queries.blogspot.com/
On Wed, Apr 6, 2011 at 1:26 PM, balaji a peshwa.bal...@gmail.com wrote:
when u throw it above
Hello friends,
The following question has appeared in two top companies of my city. I'd
appreciate if anyone is able to answer it.
Given a singly liked list comprising of three nodes
Delete the middle node such that:
1- A temp pointer is pointing to the first node
2- A temp pointer is pointing
btw, true is defined in cpp.
On Mon, Mar 28, 2011 at 12:54 PM, Umer Farooq the.um...@gmail.com wrote:
The compiler doesn't want to get killed like poor
@sourabh: could u please elaborate how u came to that conclusion.
Dave's logic seems to be right..
On Thu, Mar 31, 2011 at 11:00 AM, sourabh jakhar sourabhjak...@gmail.comwrote:
answer is 6 races
On Mon, Mar 28, 2011 at 11:53 PM, Dave dave_and_da...@juno.com wrote:
7 races.
For the
java:
System.out.println(Hamara cricket sey kiya waasta yaaro! \nHamara tou qaumi
khail Hockey hai!);
On Tue, Mar 29, 2011 at 2:29 PM, pacific :-) pacific4...@gmail.com wrote:
ruby :
putsIndia will win the worldcup 2011
On Mon, Mar 28, 2011 at 9:04 PM, shady sinv...@gmail.com wrote:
see this c code.
#includestdio.h
void fn (int *ptr)
{
const int val=100;
ptr=val;
}
void fn1(int *ptr)
{
*ptr = 100;
}
main()
{
int i=10;
printf(%d , i);
fn(i);
printf(%d , i);
fn1(i);
printf(%d , i);
}
What is the difference
B
On 4/1/11, Praveen praveen200...@gmail.com wrote:
B
On Fri, Apr 1, 2011 at 1:38 PM, Rajeev Kumar
rajeevprasa...@gmail.comwrote:
Similar question;
http://www.techinterview.org/post/518744816/more-hat-puzzles
On Fri, Apr 1, 2011 at 1:02 PM, Lavesh Rawat
lavesh.ra...@gmail.comwrote:
@Carl: the one at the bottom works..
On Fri, Apr 1, 2011 at 1:17 AM, hary rathor harry.rat...@gmail.com wrote:
everybody want to be mark.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
this is one of the Standards problems , i don't believe there is any
solution in O(n)
best solution from wiki also have complexity O(nlog(n))
http://en.wikipedia.org/wiki/Longest_increasing_subsequence
how did you made this criteria..search O(n) space O(1) ,
On 28-03-2011 18:37, Kunal
hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P
Ow please tell us the solution, I'm interested in knowing the answer :D
On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote:
Haha
On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote:
int max_calls[no_of_customers][30];
On any phone call -- max_calls[customer_id][day]++;
On hangup -- max_call[customer_id][day]--;
This would store max calls for each customer on each day. Does the length of
the call have to be taken into account ? Your question is not clear on that.
On Tue,
I think the greedy method of taking the current minimum sized 2 ropes and
tying them will do. Consider this algo:-
int getMinCost(){
priority_queue pq;
insert all thread sizes to pq;
int sum=0;
while(!pq.empty()){
int a=pq.extractmin(); //O(logn)
int b=pq.extractmin();
sum+=a+b;
no this is wrong. maintain 2 arrays
int max_calls[no of cust][31]
int current_no_of_calls[no of customers]
both array of customers are initialized to zero.
on call
current_no_of_calls[cust_id]++;
if above max[id][day] then max_calls[id][day] = above
on hangup
current_no_of_calls[cust_id]--;
On Fri, Apr 1, 2011 at 6:02 PM, snehal jain learner@gmail.com wrote:
For a set S of n real numbers, a pair of elements x, y belong to S,
where x y, are said to be close if
y – x = ( max(S) – min(S) ) / (n-1)
Suppose you are given an unsorted array A[1 : n] of distinct real
numbers.
Rather, your question is not stupid. The general definition of computability is
not well defined. We define the notion of computability by Turing Machine and
the Church-Turing thesis states that all computer models come into agreement
. But the new models of computation pose a challenge to modern
*1, 1+3^0, 2+3^1, 5+3^2, 14+3^3, 41+3^4=(122)*
On Thu, Mar 31, 2011 at 11:20 AM, rahul rahulr...@gmail.com wrote:
1+1+0, 2+2+1, 5+5+4, 14+14+13, 41+41+40
On Tue, Mar 29, 2011 at 1:05 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:
*Series Problem Solution*
1, 2, 5, 14, 41, x
Whats
'E'
On Mon, Apr 4, 2011 at 4:24 PM, Vandana Bachani vandana@gmail.comwrote:
Letter 'e'
On Mon, Apr 4, 2011 at 1:14 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:
*WHAT AM I Problem Solution*
*
*The beginning of eternity. The end of time and space. The beginning of
every end and the
The compiler doesn't want to get killed like poor
manihttp://www.allvoices.com/s/event-8408191/aHR0cDovL2JsYWNrY29icmEucG9zdGVyb3VzLmNvbS9leHRyZW1pc3QtaW5kaWEta2lsbHMtdGhlLXBvb3ItcGFycm90LWZvci1wcmU=,
therfore it is giving a compiler error :P
On Mon, Mar 28, 2011 at 10:43 AM, balaji a
i think the answer of the question will be constant to if S=sum of
length of all the rops , N=number of rops
then total cost will be *S*log(N)*
just make pair of two - two sticks tie them , repeat it again again,
Explanation of answer:
since every time we tie the cost at that level
One more query, insert into bst is O(n) and then do inorder to get them in
sorted order. This is an example of sorting in O(n) time. is this correct?
On Mon, Mar 28, 2011 at 6:06 PM, Ashim Kapoor ashimkap...@gmail.com wrote:
How do you use inorder traversal to find longest sub sequence?
On
@bittu: Can we modify the tree to store extra info?
On Mon, Mar 28, 2011 at 4:16 PM, bittu shashank7andr...@gmail.com wrote:
@all try to understand the question as usual we have to do it in min.
time space complexity ..in mean Time O(n) space o(1) At-most
just tell em after doing in-order
How do you use inorder traversal to find longest sub sequence?
On Mon, Mar 28, 2011 at 6:03 PM, bittu shashank7andr...@gmail.com wrote:
its (not aplicable).
sorting nlogn i said time O(n) O(1) space
i think we can use BST , put all elements in BST O(n) then do inorder
to find longest
The hashmap of Java is implemented using hash tables, we note that the
parameters that affect performance: initial capacity and load factor.
http://download.oracle.com/javase/1.4.2/docs/api/java/util/HashMap.html
The associative array of C + + (map) is implemented using red-black tree (
balanced
Hi , Use Hashing for That , for sum =12 arr[]={2,4,3,6,5,8,7}; store
in to hashtable for each index=0 in loop find sum-arr[index] so
fro sum =12 if we do index=1 a[1]=4 sum-a[1]=8 so stop it we have
done..hope make d perfect code.
time Complxity o(n) space size of hashtable
Let me
This is a great group. Here, we share our knowledge and get to know a lot of
new algorithmic techniques.
On Wed, Apr 6, 2011 at 4:08 PM, Carl Barton odysseus.ulys...@gmail.comwrote:
Yes
On 6 April 2011 11:36, a_SillyGuy ammukumar...@gmail.com wrote:
hi ,
i've recently joined this group in
haha :)
On Wed, Apr 6, 2011 at 4:12 PM, kunal srivastav
kunal.shrivas...@gmail.comwrote:
toughest puzzle ever :P
On Wed, Apr 6, 2011 at 1:27 PM, Akash Agrawal
akash.agrawa...@gmail.comwrote:
throw opposite to gravity...
Regards,
Akash Agrawal
http://tech-queries.blogspot.com/
On
Ok. Here's a possible O(n) solution.
Assuming last digit of a is 0.
for(n=a;n=b;n+=10)
{
Calculate the sum of digits, leaving the last digit.
Find the minimum value of last digit for it to be a heavy number.
Increment count by 10-that number.
}
So here, complexity will be: O(n/10*(d-1))
where, d
if B and C have same color than A can speak the colour
else B will.
On Fri, Apr 1, 2011 at 1:02 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote:
*Christmas Tree Problem *
*
*Four angels sat on the Christmas tree amidst other ornaments. Two had
blue halos and two – yellow. However, none of
I don't think you should sort, should u? the problem is to find the
longest sequence of consecutive elements in the given array right?
On Mar 28, 6:07 am, Kunal Patil kp101...@gmail.com wrote:
@Bittu:
Can you elaborate more how Constructing BST (I hope it stands for Binary
Search Tree) would
// O(n) solution using binning
findClose(int n, double A[n])
{
// Find min and max
min = max = A[0];
for(i = 1; i n; ++i)
{
if (A[i] max) max = A[i];
if (A[i] min) min = A[i];
}
// Set up bins
int bins = n-1;
double binWidth = (max - min) / bins;
double binTable[bins]
I think Dave is right and his solution also seems correct. Answer is 20KM
i.e. 2 trips.
Good work @Dave.
On Wed, Apr 6, 2011 at 7:43 PM, Dave dave_and_da...@juno.com wrote:
@Bittu: Actually, this is an easier problem than the Graham-Knowlton
Problem. It the GKP, you can only connect wires at
in case you are given a pointer to the first node simply do
temp -next = ( temp - next ) - next .
if you are given a pointer to the second node do ,
temp - data = ( temp - next ) - data ;
temp - next = NULL ;
correct me if I am wrong .
On Mon, Apr 4, 2011 at 9:48 PM, Umer Farooq
What exactly the median of a Binary Tree means?
On Mon, Mar 28, 2011 at 4:38 PM, Anurag Bhatia abhati...@gmail.com wrote:
@bittu: Can we modify the tree to store extra info?
On Mon, Mar 28, 2011 at 4:16 PM, bittu shashank7andr...@gmail.com wrote:
@all try to understand the question as
The General Number Field Sieve is the fastest known method of
factoring large numbers, but the elliptic curve method may be faster
in some cases. Either one is much faster than your method.
Don
On Apr 6, 12:58 pm, harish hareeshgn...@gmail.com wrote:
Hi all,
I have developed an algorithm to
In fn, ptr is a local variable passed by value. Changing ptr in the
function does not change anything in main.
Don
On Mar 31, 10:35 pm, navin navin.myhr...@gmail.com wrote:
see this c code.
#includestdio.h
void fn (int *ptr)
{
const int val=100;
ptr=val;}
void fn1(int
I fn we are simply changing the address in ptr means ptr will now points to
another variable i.e val
In fn1 we are changing the value of a variable to which ptr is pointing i.e
i so i will be changed.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
I think one way to solve is to build a max heap of the array(in place). Now
remove the max element and keep it at the end and reheapify. This algorithm
takes O(nlogn). I am not able to think how to make O(nlogk).
--
You received this message because you are subscribed to the Google Groups
There are two answers
11 and 7
On Thu, Mar 31, 2011 at 12:23 PM, Abhishek Sharma jkabhishe...@gmail.comwrote:
@sourabh: could u please elaborate how u came to that conclusion.
Dave's logic seems to be right..
On Thu, Mar 31, 2011 at 11:00 AM, sourabh jakhar
sourabhjak...@gmail.comwrote:
43 matches
Mail list logo