[algogeeks] Re: Given an integer n , you have to print all the ways in which n can be represented as sum of positive integers

2011-03-14 Thread Ralph Boland
sum is n. e.g. The numeric partitions of 3 are: {(1,1,1), (1,2), 3} 2) For each partition generate its multiset permutations. Note: there is a formula for how many of sums of positive integers to n there are but I don't what it is. Regards, Ralph Boland -- You received this message

[algogeeks] Re: first larger element in unsorted array...

2011-02-06 Thread Ralph Boland
after the data structure is constructed. For the record the O(log n) time cost for a query is optimal. (Admittedly I never actually proved this.) Regards, Ralph Boland On Jan 31, 9:25 pm,RalphBolandrpbol...@gmail.com wrote: On Jan 30, 11:00 pm, ritu ritugarg.c...@gmail.com wrote: You

[algogeeks] Re: sorted 2-d array

2010-06-08 Thread Ralph Boland
your algorithm is not. Define optimal (reasonably) than then prove that my algorithm is indeed optimal or show that some other algorithm is better by your definition. Regards, Ralph Boland -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

[algogeeks] Re: another google telephone interview question

2010-05-22 Thread Ralph Boland
thought of this even though I knew you could make quicksort be O(n log(n)) by using the the median as the pivot point. Of course I'm sure everyone realizes that one needs to stop the recursion when all the elements in a subarray are the same. Regards, Ralph Boland -- You received this message

[algogeeks] Re: another google telephone interview question

2010-05-22 Thread Ralph Boland
On May 21, 7:17 am, Bharath bharath1...@gmail.com wrote: Find the median of the values and move the lower values to left and higher values to the right. This can be done in o(n). now do the same on both the parts recursively. And the total complexity will be o(nlogk).   Further to my

[algogeeks] Re: tree from linked list

2010-05-16 Thread Ralph Boland
is to build the tree bottom up. Regards, Ralph Boland -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr

[algogeeks] Re: Complexity of Algorithms

2010-05-08 Thread Ralph Boland
performance. For example a lower bound on the average case performance of quicksort is omega(n) and an upper bound on the average case performance is O(n * n). Of course, if you are smart, you can prove that the average case performance of quicksort is theta(n * log(n)). ... Regards, Ralph

[algogeeks] Re: tree from linked list

2010-05-07 Thread Ralph Boland
a version of it that builds a weighted binary tree. I'll refrain from describing it here though because I suspect this is someones homework. :-) I will give this clue though. The tree is built bottom up, not top down which is more difficult. Regards, Ralph Boland -- You received this message

[algogeeks] Re: Largest span of Increasing Pair in an array

2010-03-20 Thread Ralph Boland
agree that this solves the problem originally posted. Regards, Ralph Boland -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email

[algogeeks] Re: Largest span of Increasing Pair in an array

2010-03-14 Thread Ralph Boland
. It is part of a larger data structure that I will implement and release as open source in a few months. Regards, Ralph Boland -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com

[algogeeks] Re: Interview question.Provide the solution as per the constraints.

2010-03-08 Thread Ralph Boland
This can be done without the parent pointer though the method may not be wise. As you traverse the tree downward you set the child pointer you traverse to point to the parent (grandparent of the child). When you traverse upward you reset the pointer of the node you traverse to point to its

[algogeeks] Re: Find nearest point

2009-11-18 Thread Ralph Boland
in the collection? The standard solution to this problem is to use a Voronoi diagram. I am only familiar with the Euclidean version but I see no problem constructing a Voronoi diagram on the surface of a sphere. Ralph Boland -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: minimum difference.

2009-09-02 Thread Ralph Boland
that is already there (O(n) expected time to build the set). Ralph Boland --~--~-~--~~~---~--~~ 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

[algogeeks] Re: Check divisibility by 3

2009-08-20 Thread Ralph Boland
On Aug 16, 7:29 pm, Ralph Boland rpbol...@gmail.com wrote: On Aug 14, 1:45 am, richa gupta richa.cs...@gmail.com wrote: can we check the divisibility of a given number by 3 withoutusing operators like '/' or '%'. I want the efficient solution to this problem .. can someone help

[algogeeks] Re: Check divisibility by 3

2009-08-16 Thread Ralph Boland
, or 15. I believe divisibility by 13 can also be done but a different algorithm is needed. Ralph Boland --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] permuting the elements of an array

2009-06-23 Thread Ralph Boland
. It will be released (in Squeak at least) under the MIT license. Thanks for any help provided. Ralph Boland --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

[algogeeks] Re: Deciding on a project

2009-05-31 Thread Ralph Boland
but it's not at all clear how to prove it. My point in all this though is that the algorithm is simple enough for a 15 year old interested in computational geometry to implement. Ralph Boland 2009/5/25 Ralph Boland rpbol...@gmail.com On May 24, 5:05 am, Albert albert.xtheunkno...@gmail.com wrote

[algogeeks] Re: Deciding on a project

2009-05-25 Thread Ralph Boland
time. If you are interested I can email you a copy of the paper. Actually you can find it on line by searching for my name or the Canadian Computational Geometry Conference. If you have problems understanding the paper I can help. Good luck whatever you decide. Ralph Boland

[algogeeks] Re: Geometric Algo..

2008-11-20 Thread Ralph Boland
values. If closest pair has first value from first set of points and second value from second pair of points then shorter arc along circle joining points contains start point. Ralph Boland --~--~-~--~~~---~--~~ You received this message because you are subscribed

[algogeeks] two solutions looking for problems to solve

2008-11-16 Thread Ralph Boland
knowledge (or ideas) of applications of these algorithms I would appreciate hearing about them. Suggestions of other groups that would be interested in my algorithms would also be appreciated. I am willing to implement these algorithms; if someone would pay me to do so of course. Thanks Ralph Boland