Re: [algogeeks] [Algorithm] Get Target

2013-04-14 Thread rogercallster n
Hi , I think we can do a very generic solution by dividing the target in three cases 1) Target is smaller than all the 6 integer 2) Target is in between the 6 integers 3) Target is greater than all 6 integers solving case 1) search if any given integer is multiple of the target else try to get t

Re: [algogeeks] [Algorithm] Get Target

2013-04-09 Thread prankur gupta
I guess we are allowed to use the operation multiple times. I had thought of the solution, could you please look below and tell me whether I'm missing any case or not. I know the complexity of the solution is very bad(exponential). But if you have some other cool algorithm I would be happy to hear.

Re: [algogeeks] [Algorithm] Get Target

2013-04-03 Thread atul anand
are we allowed to use operation only once or multilpe times? On Fri, Mar 22, 2013 at 6:27 AM, prankur gupta wrote: > Hi All, > > Could you help me this question. > This was asked at Yelp Interview. > > Given 6 integers and 1 target value, write a function to get the target > value using 6 intege

[algogeeks] [Algorithm] Get Target

2013-04-03 Thread prankur gupta
Hi All, Could you help me this question. This was asked at Yelp Interview. Given 6 integers and 1 target value, write a function to get the target value using 6 integers with any on these operations +,*,-,/ Thanks -- PRANKUR GUPTA Masters Student (CSE) State University of New York Stony Brook

Re: [algogeeks] Algorithm Question

2012-05-24 Thread sanjay pandey
min heap wid N elements containing first line from each file will do... remove the top most n insert next one from dat file only -- 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.c

Re: [algogeeks] Algorithm Question

2012-05-23 Thread Karthikeyan V.B
Hi, k-way merge procedure of external sorting should be applied -- 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+unsubsc

Re: [algogeeks] Algorithm Question

2012-05-23 Thread Prem Krishna Chettri
First thing on my Mind External Sorting. On Wed, May 23, 2012 at 7:21 PM, Decipher wrote: > Given N files on disk of sizes < 16 GB, containing integers in sorted > order, one integer per line. Create a single file with all the integers in > sorted order. > Usage : sortEM (file1, file2) > file1 h

[algogeeks] Algorithm Question

2012-05-23 Thread Decipher
Given N files on disk of sizes < 16 GB, containing integers in sorted order, one integer per line. Create a single file with all the integers in sorted order. Usage : sortEM (file1, file2) file1 has list of input files, one name per line file2 is the name of file into which the output has to be

Re: [algogeeks] algorithm that returns number of internal nodes in the tree

2012-05-09 Thread atul anand
internal_nodes=TotalNodes(root) - No_of_leaf_nodes(root); On Wed, May 9, 2012 at 1:19 PM, Amit Jain wrote: > Here is my version > > Algorithm count(x) > > 1: if (x==nil || (left[x]== nil and right[x]==nil)) > 2: return 0 > 3: return count(left[x]) + count(right[x]) +1 > > Time Complexity: O

Re: [algogeeks] algorithm that returns number of internal nodes in the tree

2012-05-09 Thread Amit Jain
Here is my version Algorithm count(x) 1: if (x==nil || (left[x]== nil and right[x]==nil)) 2: return 0 3: return count(left[x]) + count(right[x]) +1 Time Complexity: O(n) where is n is total number of node in tree. Thanks On Wed, May 9, 2012 at 11:17 AM, Akshay Rastogi wrote: > you are n

Re: [algogeeks] algorithm that returns number of internal nodes in the tree

2012-05-08 Thread Akshay Rastogi
you are not checking whether the current node is an internal node or not !! On Thu, May 3, 2012 at 12:47 AM, Rose wrote: > Is this algorithm right or how shall I write it? > > * > * > > * > * > > *Construct an algorithm **Intern(**x**)**, which returns the number of > internal nodes in the tree.

[algogeeks] algorithm that returns number of internal nodes in the tree

2012-05-03 Thread Rose
Is this algorithm right or how shall I write it? * * * * *Construct an algorithm **Intern(**x**)**, which returns the number of internal nodes in the tree. * * * Algorithm Intern(x) 1: if (x = nil) then 2: return 0 3: else 4: return 1 + Intern(left[x]) + Intern(right[x]) 5: en

[algogeeks] Algorithm internship question paper NSIT

2012-04-26 Thread deepikaanand
28 questions 120 min +1/-0.25 3 programming qs 1.to add two numbers stored in link list 2.to test is the given tree is a sumtree or not 3.to store numbers from a tree to a file and then retrieve those values and buld the tree Objective type qs 1. rec= fork(); rec= fork(); rec= fork(); rec= fork()

[algogeeks] algorithm to sort based on frequency.

2012-02-01 Thread Varun
I was asked this question sometime during an interview. WE have an array of known length. The elements in array can be repetitive. now sort the array based on frequency of occurrence of each element in array. Eg: a= {4.3.2.5.4.6.2.6} after sorting a={4,4,2,2,6,6,3,5} 4,2,6 all occurs twice, in t

[algogeeks] Algorithm page

2011-10-05 Thread Wladimir Tavares
Hi Guys, I created this page to place some materials on algorithms. Suggestions are welcome. https://sites.google.com/site/quixadamaratona/ Ps: The page is in Portuguese. Best wishes, * * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.

[algogeeks] algorithm problem

2011-09-16 Thread pankaj kumar
You are given two end points ( consider them as two end stations at some distance ) there are 100 stations between these two . Now you need to build a train track between these two end points which includes only 10 stations and not more than that . Now the objective is to find such 10 stations suc

Re: [algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-31 Thread jai gupta
With hashing.. make a hash table of elements from 0 to sum/2 if an element k is in sum/2 to sum then check if sum-k is in the hashtable. take care of the case when sum is even and sum/2 occurs only once. TC: O(n) Space complexity: O(sum) Method2: Sort the elements. Now maintain to pointers one at

Re: [algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-31 Thread SANDEEP CHUGH
can be done in O(n) with hashing On Wed, Aug 31, 2011 at 11:09 AM, Ankit Minglani wrote: > one method can be : > > Let T = the sum > > for(i=0;i { >temp=T- x[i]; >// perform a binary search on array[ i+1. n-1] to find temp it if > does then just output. > } > > > > > > > > > > > > > O

Re: [algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-30 Thread Ankit Minglani
one method can be : Let T = the sum for(i=0;i wrote: > Its brute force method.O(n^2) algo... > for(int i=0;i for(int j=i+1;j { > if(x==A[i]+A[j]) > { print A[i],A[j]; break;} > > } > > On Wed, Aug 31, 2011 at 1:15 AM, Reynald wrote: > >> For example, in array, say, >> <

Re: [algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-30 Thread saurabh singh
Discussed so many times on the group search in the group archive..No point repeating things again and again On Wed, Aug 31, 2011 at 11:04 AM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > Its brute force method.O(n^2) algo... > for(int i=0;i for(int j=i+1;j { >

Re: [algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-30 Thread bharatkumar bagana
Its brute force method.O(n^2) algo... for(int i=0;i wrote: > For example, in array, say, > <8, 9, 2, 4, 6, 2, 3> > > Input 5, output 2 and 3. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to alg

[algogeeks] Algorithm to find two numbers in an array that sum up to a given number

2011-08-30 Thread Reynald
For example, in array, say, <8, 9, 2, 4, 6, 2, 3> Input 5, output 2 and 3. -- 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 algoge

Re: [algogeeks] Algorithm

2011-08-16 Thread atul purohit
@Pramod Nice work. Although I think Carrot = 100 - percentage and Stick = percentage will work instead of the current values. On Tue, Aug 16, 2011 at 1:13 AM, PramodP wrote: > Here is a modified function that finds the element that crosses a > particular percentage in an array. Please note tha

Re: [algogeeks] Algorithm

2011-08-15 Thread PramodP
Here is a modified function that finds the element that crosses a particular percentage in an array. Please note that the code returns a false value if there is no number that appears more frequently than the input percentage. Loop through the array in O(n) and ensure that num indeed is an acceptab

Re: [algogeeks] Algorithm

2011-08-15 Thread Dipankar Patro
For n/2 I came across a nice algo sometime back. here is how to do it (I am providing algo): int A[n], i, num, freq=0; set num = A[0] and freq= 1; // assume first number to be the >n/2 times occurring element. from i=1 to n-1 { if (A[i] == num) freq++; else freq--; freq = (freq < 0)

[algogeeks] Algorithm

2011-08-15 Thread contiguous
Design an algorithm to find all elements that appear more than n/2 times in the list. Then do it for elements that appear more than n/4 times. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@goog

Re: [algogeeks] Algorithm complexity

2011-08-03 Thread raj kumar
Searching a node in a tree of string or integer arrays and then using binary search withinn that node to retrive a particular value -- 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.co

[algogeeks] Algorithm complexity

2011-08-03 Thread Ajai Sathyan
Can u suggest a program with complexity O( log 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...@goo

[algogeeks] Algorithm complexity

2011-08-03 Thread Ajai Sathyan
Can you suggest a sample program which has complexity O(log log n)? Regards Ajai Sathyan -- 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 e

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-12 Thread Divye Kapoor
I used a map and implemented the code. The algo to achieve this can be done in under 10 lines, the overall program is < 50 lines. You can have a look at the code here: https://github.com/swagatata/ds_and_algos/blob/master/cpp/trivia/currency_conversion.cpp The basic idea is to use an approach si

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread sunny agrawal
may be a map can help that maps string to their integer values ans then using some set of rule to convert to a number On Sun, Jun 12, 2011 at 12:28 AM, Abhishek Goswami wrote: > @I got one of my interview . I tried to solve this issue but could not > it...I did googling but could not help me much

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
@I got one of my interview . I tried to solve this issue but could not it...I did googling but could not help me much... On Sun, Jun 12, 2011 at 12:26 AM, Abhishek Goswami wrote: > Can you bit descriptive.. > > > On Sat, Jun 11, 2011 at 7:27 PM, rahul rai wrote: > >> Count the number of spaces i

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
Can you bit descriptive.. On Sat, Jun 11, 2011 at 7:27 PM, rahul rai wrote: > Count the number of spaces in the sentence. If the last word is > {one/two .} the just do the calling on the speciab part of code > printing the rest of sentence > > On 6/11/11, rahul rai wrote: > > I wonder if th

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread rahul rai
I wonder if there is any practical use of this algorithm for real life implementation . . Please let me know where you caught this problem On 6/11/11, Abhishek Goswami wrote: > Hi, > Can anyone have algorithm or program for convert word into number > > Input. Three hundred twenty three : o

Re: [algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread rahul rai
Count the number of spaces in the sentence. If the last word is {one/two .} the just do the calling on the speciab part of code printing the rest of sentence On 6/11/11, rahul rai wrote: > I wonder if there is any practical use of this algorithm for real life > implementation . . Please let m

[algogeeks] Algorithm or Program for convert word into number

2011-06-11 Thread Abhishek Goswami
Hi, Can anyone have algorithm or program for convert word into number Input. Three hundred twenty three : output 323 InputTwenty : output -20 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To po

Re: [algogeeks] Algorithm for dynamic resource allocation

2011-05-04 Thread dinesh bansal
You can assign weight to all the consumers based on priority and then divide all the resource based on weight. On Wed, May 4, 2011 at 6:13 PM, LiveShell wrote: > Hi all, > > I am working on dynamic resource allocation problem. I have set of > Consumer and resource. Consumers are with priority (

Re: [algogeeks] Algorithm for dynamic resource allocation

2011-05-04 Thread ADITYA KUMAR
how much resource each customer needs...?? On Wed, May 4, 2011 at 6:13 PM, LiveShell wrote: > Hi all, > > I am working on dynamic resource allocation problem. I have set of > Consumer and resource. Consumers are with priority (High, Medium, > Low). Now I want to assign resource slice to each con

[algogeeks] Algorithm for dynamic resource allocation

2011-05-04 Thread LiveShell
Hi all, I am working on dynamic resource allocation problem. I have set of Consumer and resource. Consumers are with priority (High, Medium, Low). Now I want to assign resource slice to each consumer based on priority and no of consumers. ie Priority| No of Consumers --

[algogeeks] Algorithm Monthly Contest (Prize $50)

2011-03-25 Thread ravi maggon
Hey, Monthly challenge of http://algorithmguru.com has started.participate to excel your skills in algorithms and win prizes worth $50. -- Regards Ravi Maggon -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send

Re: [algogeeks] Algorithm to find whether any 3point on the same line

2010-10-23 Thread preetika tyagi
You have to scan every pair of points only once to get the value of 'm' and 'a', so the time complexity would be O(n^2). On Sat, Oct 23, 2010 at 6:22 PM, Meng Yan wrote: > there are (n*(n-1))/2pairs of points. I think if we use your method, the > time complexity should be O(n^4). > > Is it poss

Re: [algogeeks] Algorithm to find whether any 3point on the same line

2010-10-23 Thread Meng Yan
there are (n*(n-1))/2pairs of points. I think if we use your method, the time complexity should be O(n^4). Is it possible to put all points into k different domain and using T(n)=T(n/k)+f(n) to solve this problem? On Sat, Oct 23, 2010 at 7:51 PM, preetika tyagi wrote: > Is there any specific nee

Re: [algogeeks] Algorithm to find whether any 3point on the same line

2010-10-23 Thread preetika tyagi
Is there any specific need to use recursion? One alternate is to find slope and constant (m and c) for every pair of points and same value of m & c will specify the points on the same line. Time complexity is O(n*n). On Sat, Oct 23, 2010 at 4:31 PM, Meng Yan wrote: > Given n point on the plane

[algogeeks] Algorithm to find whether any 3point on the same line

2010-10-23 Thread Meng Yan
Given n point on the plane, find out whether any 3point on the same line. How to use recursion to solve the problem? Could you help me find the algorithm and give the time complexity? Bests, Claire -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" g

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-10-19 Thread Wladimir Tavares
;>> >>> On Fri, Oct 1, 2010 at 6:00 AM, adit.sh...@gmail.com < >>> adit.sh...@gmail.com> wrote: >>> >>>> The problem here is more about finding the most optimal solution and not >>>> just solution. >>>> Rgds >>>> Ad

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-10-19 Thread Wladimir Tavares
t;> >>> The problem here is more about finding the most optimal solution and not >>> just solution. >>> Rgds >>> Adi >>> -Original Message- >>> From: Sathaiah Dontula >>> Sent: 29/09/2010, 09:25 >>> To: algogeeks@googlegroups.

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-10-18 Thread Marcelo Amorim Menegali
here is more about finding the most optimal solution and not >> just solution. >> Rgds >> Adi >> -Original Message- >> From: Sathaiah Dontula >> Sent: 29/09/2010, 09:25 >> To: algogeeks@googlegroups.com >> Subject: Re: [algogeeks] Algo

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-10-16 Thread nishaanth
gds > Adi > -Original Message- > From: Sathaiah Dontula > Sent: 29/09/2010, 09:25 > To: algogeeks@googlegroups.com > Subject: Re: [algogeeks] Algorithm to determine the largest number of > envelopes that can be nested inside one another. > > > I think we can do

RE: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-30 Thread adit.sh...@gmail.com
The problem here is more about finding the most optimal solution and not just solution. Rgds Adi -Original Message- From: Sathaiah Dontula Sent: 29/09/2010, 09:25 To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-29 Thread Sathaiah Dontula
I think we can do like this, 1. Sort all the xi's in ascending order -> nlog(n) 2. Then find the longest increasing sequence of yi's -> nlog(n) 3. complexity will be nlog(n). Thanks, Sathaiah Dontula On Tue, Sep 28, 2010 at 11:37 PM, Prashant Kulkarni < prashant.r.k...@gmail.com> wrote: > i thi

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-28 Thread Prashant Kulkarni
i think it is similar to finding max in a list O(n) or sorting algorithm O(n log n) -- Prashant Kulkarni On Tue, Sep 28, 2010 at 11:33 PM, Rahul Singal wrote: > A possible solution i can think is create a directed graph where each > vertex is a envelope and edges are from a bigger envelope

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-28 Thread Rahul Singal
A possible solution i can think is create a directed graph where each vertex is a envelope and edges are from a bigger envelope to smaller envelope ( one which can fit in bigger envelope ) . Now the problem is reduce to finding longest path in the graph . Regards Rahul -- You received this mess

[algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-28 Thread Divesh Dixit
You are given an unlimited number of each of n different types of envelopes. The dimensions of envelope type i are xi × yi.(i is in sub script) In nesting envelopes inside one another, you can place envelope A inside envelope B if and only if the dimensions A are strictly smaller than the dimension

Re: [algogeeks] Algorithm to find all subsets of size K

2010-08-22 Thread Raj N
Generate all binary strings of length k. For eg: S={1,2,3,4,5} generate all binary strings of length 5. 0 represents that particular number is absent and 1 for the presence of the number. On Fri, Aug 13, 2010 at 11:35 PM, asdf wrote: > Most efficient algorithm to find all subsets of size K?? > >

[algogeeks] Algorithm to find all subsets of size K

2010-08-14 Thread asdf
Most efficient algorithm to find all subsets of size K?? -- 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...@goo

[algogeeks] algorithm

2010-07-31 Thread jalaj jaiswal
given a rand5 function which generates numbers from 1 to 5 with equal probability.. give an algorithm which uses rand5 function and generates numbers from 1 to 7 with equal probability -- With Regards, Jalaj Jaiswal +919026283397 B.TECH IT IIIT ALLAHABAD -- You received this message because you

Re: [algogeeks] ALGORITHM

2010-07-29 Thread Manjunath Manohar
we can find the sum of all elements i.e, n(n+1)/2. and then compute the sum of all squares of elements..i.e (n(n+1)(2n+1))/6 now u have two equations..u can now compute both the missing element and the duplicate.. -- You received this message because you are subscribed to the Google Groups "Algo

Re: [algogeeks] ALGORITHM

2010-07-29 Thread Ashish kumar Jain
Good approach Shiv.I think thats the best way to do so.The question does not strictly say we have consecutive n-1 distinct numbers.So,its not worth considering that particular case. On Thu, Jul 29, 2010 at 12:08 AM, Shiv ... wrote: > What if the number are not consecutive? > > My approach- > Put

Re: [algogeeks] ALGORITHM

2010-07-28 Thread Shiv ...
What if the number are not consecutive? My approach- Put the numbers in a hash till a collision occurs. On Wed, Jul 28, 2010 at 9:21 PM, Apoorve Mohan wrote: > Solution : > > 1. Find Xor of numbers from 1 to n-1. > > 2. Find Xor of the numbers present in the array. > > 3. Xor the results from st

Re: [algogeeks] ALGORITHM

2010-07-28 Thread Apoorve Mohan
Solution : 1. Find Xor of numbers from 1 to n-1. 2. Find Xor of the numbers present in the array. 3. Xor the results from step 1 and 2 you will get the repeated number. On Wed, Jul 28, 2010 at 8:46 PM, akshay wrote: > An array of unsorted numbers n is given with one no.repeated once ie > n-1

[algogeeks] ALGORITHM

2010-07-28 Thread akshay
An array of unsorted numbers n is given with one no.repeated once ie n-1 distinct nos to find duplicate no. in o(n) complexity -- 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

Re: [algogeeks] algorithm

2010-07-26 Thread Manjunath Manohar
@Anand...for better efficiency..we can find the pivot as a random integer..for better worst case complexity.. -- 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

Re: [algogeeks] algorithm

2010-07-26 Thread Anand
* * *Using partition Logic of Quick Sort: * *Algoritm:* 1. pivot = 1st element. 2. Find the position of pivot in the array using partition logic of Quick sort 3. If Rank lies on the right side of the position then call this function with the right array 4. If rank lies on the l

Re: [algogeeks] algorithm

2010-07-25 Thread Algoose chase
Add Each number from the stream to a Doubly linked list in sorted fashion i = 1; j = 1; while( stream not empty) { if( i == 1&& j == 1) { Median = Cur ; /*Create New list with ist Number*/ } Add_Node_In_Sorted_Order(Cur); If( If new node is added af

[algogeeks] algorithm

2010-07-24 Thread jalaj jaiswal
You are given a stream of numbers which can be positive or negative. You are required to provide an operation FIND MEDIAN..which when invoked should be able return the median of the numbers in stream (in sorted order) in O(1) time. Eg: 0 1 2 3 4 Right FIND MEDIAN returns 2 as median Now input is

[algogeeks] Algorithm Books/Sites

2010-07-20 Thread Tech Id
What are the best books/sites available to get a great hands-on on algorithms? I am basically looking for books/sites that explain well to a non- computer-science student. Maths/Algebra should be there but in an easy to understand manner and should cover a really wide range. A fat book should als

Re: [algogeeks] algorithm to draw a line

2010-07-12 Thread Anand
Algorithm to draw a line. While searching on net, I got few pointers. http://www.cs.unc.edu/~mcmillan/comp136/Lecture6/Lines.html On Mon, Jul 12, 2010 at 4:53 PM, ashish agarwal < ashish.cooldude...@gmail.com> wrote: > draw a line or equation of a line? > > On Mon, Jul 12, 2010 at 4:38 PM, Anand

Re: [algogeeks] algorithm to draw a line

2010-07-12 Thread ashish agarwal
draw a line or equation of a line? On Mon, Jul 12, 2010 at 4:38 PM, Anand wrote: > 2 coordinate points p(x,y)and q(x,y) are given and write an algorithm to > draw aline > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this

[algogeeks] algorithm to draw a line

2010-07-12 Thread Anand
2 coordinate points p(x,y)and q(x,y) are given and write an algorithm to draw aline -- 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] Algorithm

2010-07-05 Thread Abhishek Sharma
You are given a set of phrases (let us call them keywords), each of 1-4 words. Group the keywords into clusters (groups of keywords) by picking keywords which are similar to each other. There are multiple ways to cluster(group) them 1) using single keyword as the cluster name. Eg cluster name "gif

[algogeeks] algorithm for jig saw puzzle

2010-07-03 Thread divya
Jig saw puzzle, What are the data structures? Assume you have some method which can tell you if two pieces fit together. How would you solve the puzzle, minimizing the number of times you have to call that function? -- You received this message because you are subscribed to the Google Groups "Al

[algogeeks] Algorithm intensive Please solve

2010-02-12 Thread GentLeBoY
given 2N points in a plane. Pair up to obtain N distinct pairs such that total sum of paired distances is minimum. N can be atmost 50. -- 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

Re: [algogeeks] Algorithm for vector problem

2009-11-24 Thread Algoose Chase
void PrintFamilyTree(const short& generation) { printf("Name : %s Generation = %d\n", m_Name.c_str(),generation); vector::iterator it; for (it = this.begin(); it< this.end() ;it++) { it->PrintFamilyTree(generation+1); } } On Tue, Nov 24, 2009 at 9:20 PM, Aditya Shankar < iitm.adi

Re: [algogeeks] Algorithm for vector problem

2009-11-24 Thread Aditya Shankar
Hi, On Tue, Nov 24, 2009 at 6:38 PM, Ankur wrote: > What would be the best algorithm for the undermentioned problem. > > Implement method PrintFamilyTree() that prints out the Name and > Generation of the tree > Output should resemble > Name: Jan Generation:0 > Name: Mike Generation:1 > Name: Gr

[algogeeks] Algorithm for vector problem

2009-11-24 Thread Ankur
What would be the best algorithm for the undermentioned problem. Implement method PrintFamilyTree() that prints out the Name and Generation of the tree Output should resemble Name: Jan Generation:0 Name: Mike Generation:1 Name: Greg Generation:2 Name: Carol: Generation: 2 Name: Peter Generation: 3

[algogeeks] algorithm to find Anagrams

2009-01-21 Thread dinesh bansal
Hi All, Can anyone provide me a good program/algorithm to find all anagrams for a given word. Input string should be of variable length (max 26 char). Just printing is not enough, we need to store the output to a file or static memory somewhere. Thanks in advance. -- Dinesh Bansal The Law of Wi

[algogeeks] Algorithm needed for optimizing a grid layout

2008-10-09 Thread moonlight
Hi, I'm a hobbyist programmer and need an algorithm for finding a best fit for laying out a grid of graphics objects (square pictures with captions) in a given rectangle or in a given range between X1 and X2. User defined input: imageCount imageMinSide, imageMaxSide gutterMin, gutterMax X1 & X2

[algogeeks] Algorithm and DS for generating valid words from bag of (15) letters

2008-06-26 Thread dingo
There are plenty of games on net, where You have fixed (randomly generated) letters (let's say fifteen of them) and You have to make up as many valid words You can. There are some constraints, like word must bet nominative noun, but it doesn't really matters, You count on external word-list. Let'

[algogeeks] Algorithm composition, combination or aggregation

2008-03-26 Thread jorgeba
Hello, I am writting to ask if you know the difference between algorithm composition, algorithm combination and algorithm aggregation. For example, a weighted sum of algorithms I think that it is a combination. But I can imagine examples of composition or aggregation. Thank you very much in

[algogeeks] Algorithm book

2007-09-16 Thread Raj
does anyone has jon kleinberg Algorithm design ebook. Please mail as attachment. Raj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegr

[algogeeks] Re: Fwd: [algogeeks] algorithm brute-forcing

2007-04-07 Thread Dennis Yurichev
On 8 апр, 03:03, "Pradeep Muthukrishnan" <[EMAIL PROTECTED]> wrote: > I dont completely get the question...Is the set of possible inputs bounded? > If yes, then why cant we generate all possible inputs and feed it to the > black box? hope u can clarify it more? I'm sorry, more on that is there: h

[algogeeks] Fwd: [algogeeks] algorithm brute-forcing

2007-04-07 Thread Pradeep Muthukrishnan
:36 AM Subject: [algogeeks] algorithm brute-forcing To: Algorithm Geeks Hi. What we have: we have a black box with some unknown crypto algorithm inside. We can test it as many times as we want, placing input data and key at input and see output. We know that black box is just one something lik

[algogeeks] algorithm brute-forcing

2007-04-07 Thread Dennis Yurichev
Hi. What we have: we have a black box with some unknown crypto algorithm inside. We can test it as many times as we want, placing input data and key at input and see output. We know that black box is just one something like LFSR implementation (Linear feedback shift register), modified somehow, bu

[algogeeks] Algorithm for searching k-median across arrays

2006-07-23 Thread krisp
Hi, I am looking for an efficient algorithm to search for k-median across disjointed vectors. For example, I have 10 different size arrays of floats (size varies from 20k to 100k elements) from which I would like to get 1000th element of the combined set (total set is 500k elements). Current

[algogeeks] Algorithm for sorting 7 elements

2006-06-12 Thread [EMAIL PROTECTED]
Hi, I would like to know which is the best algorithm for sorting 7 elements. I have an array which is having 7 columns and many rows. I want to sort all the columns individualy. So i want to know which is the algorithm that i have to use for it. Thanks and regards Amal P. --~--~-~--

[algogeeks] Algorithm for time-slot allocation

2006-05-06 Thread Anish Nema
hi, I am new to this group, I am looking for an algorithm for allocating time-slots in a scheduling table. Scheduling table has a depth of n ( max value 2048 ) time slots and it can be used to schedule m ( max value 512 ) queues. A queue can have at most 12 time slots in the calendar table. Main r

[algogeeks] algorithm analysis - pedagogical questions

2006-01-26 Thread H.
I'm new to the formal study of analyzing algorithms. Questions for any reader with even a modicum of experience - thanks in advance for any feedback! 1) What tools and techniques do you utilize when analyzing algorithms? Is your preferred way to draw box-and-pointer diagrams out on paper, for in

[algogeeks] algorithm to identify number from 0-16384 having at most 4 1s in its binary number

2006-01-23 Thread Ujjaval
Hey all, I want to get the numbers from 0-16384 whose equivalent binary number has at the most 4 1s in it. I can do this by setting up a counter and doing an AND operation of a number with all numbers which are power of 2 between 0-16384. I update the couter for each successful AND operation and