<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Algorithms Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'Algorithms' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2009 Programmers Heaven</copyright>
    <pubDate>Fri, 03 Jul 2009 18:10:28 -0700</pubDate>
    <lastBuildDate>Fri, 03 Jul 2009 18:10:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Color Sequencing</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/393199/393199/color-sequencing/</link>
      <description>This might interest some of you. I have this table of 44 colors of a product. While the base product materials are the same, the dyes have different chemical compositions -- and some can be run right after the other in a mixer, some can't. The table looks something like this:&lt;br /&gt;
&lt;br /&gt;
  &lt;pre class="sourcecode"&gt;                (Next Batch)
(In Mixer)  White   Blue   Green   Orange   Black
White         X       X      X        X       X
Blue                  X                       X
Green                 X      X        X
Orange                                X       X
Black                                         X
...etc.&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Where there's an 'X', the mixer can go from the color in the mixture to the next batch. Where there's a blank, the mixer has to be completely cleaned out (the process of about an hour). &lt;br /&gt;
&lt;br /&gt;
So I'm writing an application that takes a subset of these colors (whatever the customers have ordered and needs to be made that day) and tries to find the run with the fewest cleanouts possible. &lt;br /&gt;
&lt;br /&gt;
What I've come up with so far (and works for small numbers of colors) is a brute-force algorithm that tries every product in every order and returns the shortest list. E.g. For White, Blue, and Green, the program returns "White, Blue, &amp;lt;Cleanout&amp;gt;, Green". The only problem with this is that the algorithm is N!. The execution time for 8 colors is less than a second. 9 colors takes about 6 seconds. 10 takes almost a full minute (10! = 3,628,800 combinations to check). 11 colors is almost 12 minutes....you can see where this is going. &lt;br /&gt;
&lt;br /&gt;
There's gotta be a mathematical model for this somewhere and a better algorithm, but I'm not sure what it's called. Has anybody seen a problem like this before? &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/393199/393199/color-sequencing/</guid>
      <pubDate>Thu, 02 Jul 2009 08:02:19 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>partition set of integers</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/393138/393138/partition-set-of-integers/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
I need to partition a set S of integers into k subsets, so that the variance of the sum of the integers in each partition is minimized.&lt;br /&gt;
&lt;br /&gt;
Example, for k=3&lt;br /&gt;
&lt;br /&gt;
the original set:&lt;br /&gt;
S = {1, 1, 2, 4, 6, 17, 19, 25, 28, 39, 49}&lt;br /&gt;
&lt;br /&gt;
is split into:&lt;br /&gt;
s1={28,19,17}&lt;br /&gt;
s2={39,25}&lt;br /&gt;
s3={49,6,4,2,1,1}&lt;br /&gt;
&lt;br /&gt;
because it minimizes var(63, 64, 64)&lt;br /&gt;
&lt;br /&gt;
Note that S can have a large number of elements... so I need something relatively efficient.&lt;br /&gt;
&lt;br /&gt;
Any help would be appreciated.&lt;br /&gt;
&lt;br /&gt;
Thanks!!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/393138/393138/partition-set-of-integers/</guid>
      <pubDate>Wed, 01 Jul 2009 14:35:53 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>HeapSort Problem</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392944/392944/heapsort-problem/</link>
      <description>Got a question for heapsort need to handle in short time &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
input array A[1.....n] &lt;br /&gt;
&lt;br /&gt;
Sorting algorithms should compute a sorting permutation pi[1...n] &lt;br /&gt;
&lt;br /&gt;
which satisfies the following (1) it is permutation ie pi[i] belong&lt;br /&gt;
{1...n} and for all i != j hava pi[i]！ = pi[j] (2) pi sorts (i.e) if we filled an array B[1...n] by placing A[i] into B[pi[i]] then B would be in sorted order. &lt;br /&gt;
&lt;br /&gt;
for example if A= [ 8,5,11,6] the sorting permutation would be [3,1,4,2] since in the sorted array "8" should be in position 3, "5 " should be in position 1 etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Show how to modify Heapsort such that it leaves the input &lt;br /&gt;
array A unchanged and computess the sorting permutation pi &lt;br /&gt;
&lt;br /&gt;
instead You may assume that all input integers are distinct. You should have O (nlog n) worst-case run time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
thanks for helppp!!!!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392944/392944/heapsort-problem/</guid>
      <pubDate>Sat, 27 Jun 2009 20:21:15 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>HeapSort Problem</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392943/392943/heapsort-problem/</link>
      <description>Got a question for heapsort need to handle in short time &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
input array A[1.....n] &lt;br /&gt;
&lt;br /&gt;
Sorting algorithms should compute a sorting permutation pi[1...n] &lt;br /&gt;
&lt;br /&gt;
which satisfies the following (1) it is permutation ie pi[i] belong&lt;br /&gt;
{1...n} and for all i != j hava pi[i]！ = pi[j] (2) pi sorts (i.e) if we filled an array B[1...n] by placing A[i] into B[pi[i]] then B would be in sorted order. &lt;br /&gt;
&lt;br /&gt;
for example if A= [ 8,5,11,6] the sorting permutation would be [3,1,4,2] since in the sorted array "8" should be in position 3, "5 " should be in position 1 etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Show how to modify Heapsort such that it leaves the input &lt;br /&gt;
array A unchanged and computess the sorting permutation pi &lt;br /&gt;
&lt;br /&gt;
instead You may assume that all input integers are distinct. You should have O (nlog n) worst-case run time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
thanks for helppp!!!!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392943/392943/heapsort-problem/</guid>
      <pubDate>Sat, 27 Jun 2009 20:20:14 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>There is a science competition for elementary school kids.</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392921/392921/there-is-a-science-competition-for-elementary-school-kids/</link>
      <description>The competition is open to kids who are in schools in our county. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
For the purposes of the exercise, let’s say there are two teams from each school that compete.  One team is the Math team, and one team is the Physics team.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Each team consists of 3 students.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The rules say that only 4 students from each grade are allowed to attend, because the building where the competition takes place is very small.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This means that even though there are two teams of 3 students each, some students will have to be on both teams.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The children of the coaches are automatically given a position on the team they are coaching. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now, let’s say 6 kids sign up to go to the competition.  The school has to figure out how to select 4 of these 6 kids to compete. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We have two coaches, so we know their kids each have a spot.  That leaves 4 team positions open.  But since each school is limited to only sending 4 kids total, we can only choose 2 other kids to fill in the remaining spots.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What method do you use to choose the additional 2 kids? &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In general, we want to solve the problem of having n teams with 3 members each, with a limit of x kids per school.  In the example above, n = 2 and x = 4. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
I hope that makes sense.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the actual competition I’m trying to help with, there are 36 available team positions, but only 20 kids per school are allowed to attend the competition.  So if we have 36 kids sign up for 2nd grade, we have to cut 16 of them.  (The kids whose parent are coaches won’t be cut.)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392921/392921/there-is-a-science-competition-for-elementary-school-kids/</guid>
      <pubDate>Fri, 26 Jun 2009 16:17:57 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>QR code</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392549/392549/qr-code/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I write QR decoder.&lt;br /&gt;
If I get distortion QR image,&lt;br /&gt;
decoder cannot recognize it.&lt;br /&gt;
For example, if I make QR photo angularly.&lt;br /&gt;
How can I adjust QR image?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392549/392549/qr-code/</guid>
      <pubDate>Fri, 19 Jun 2009 13:38:17 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Permutation and Combination  Algorithm Please help!!!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392245/392245/permutation-and-combination--algorithm-please-help/</link>
      <description>Hello Folks,&lt;br /&gt;
With regards to math and algorithms in general, you are the only minds I could think of that could help me solve this problem I've been battling with for the past two days. Your help will be very much appreciated. So here it goes.&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;br /&gt;
The Question is I can have a series of numbers consisting of N number of sixes and a single other number between one and five. I have X number of individuals over which i can distribute the series of numbers.&lt;br /&gt;
&lt;br /&gt;
So for instance X1 can take B number of sixes and 1 other integer and X2 can take C number of sixes such that B+C+ (1 other integer) will exhaust the series. In other words any number of X over which the distribution is done over must completely exhaust the series.&lt;br /&gt;
&lt;br /&gt;
The purpose of the algorithm I want is to find out all the possible ways of distributing N sixes and 1 other integer over X number of individuals such that any number of X over which the distribution is done completely exhaust the series.&lt;br /&gt;
&lt;br /&gt;
I hope I've explained the problem clearly enough?&lt;br /&gt;
&lt;br /&gt;
I would also appreciate it if this addition could be made to the algorithm: the distributions may be done over any X individual in either negative bias or positive bias. so for instance X1 may take B number of -(sixes) and 1 -(other number) and X2 can take C number of sixes such that it completely exhausts the series thus if I have a series of 3 sixes and two to distribute over four individuals i can have the following distributions:&lt;br /&gt;
&lt;br /&gt;
Distribution:1&lt;br /&gt;
X1:{6,6,6,1}&lt;br /&gt;
X2:&lt;br /&gt;
X3:&lt;br /&gt;
X4:&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
Distribution:2&lt;br /&gt;
X1:-{6,6,6,1}&lt;br /&gt;
X2:&lt;br /&gt;
X3:&lt;br /&gt;
X4:&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
Distribution:3&lt;br /&gt;
X1:{6,6}&lt;br /&gt;
X2:-{6,1}&lt;br /&gt;
X3:&lt;br /&gt;
X4:&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
Distribution:4&lt;br /&gt;
X1:{6,1}&lt;br /&gt;
X2:-{6}&lt;br /&gt;
X3:{1}&lt;br /&gt;
X4:&lt;br /&gt;
and so on!&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
X1:6,6,6,1=X1:6,1,6,6 = X1:1,6,6,6 and so on...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Well that's it. one way I thought of doing this was to do the math and find out the number of possible ways to do the distribution and then randomly generate some possible ways such that each newly generated pattern does not match a previously generated pattern of distribution, until the number of generated patterns equals the number of possible ways but of course this would take forever to complete and will be come very inefficient as the number of pattern grows!&lt;br /&gt;
&lt;br /&gt;
The algorithms can be written in pseudo code or presented in a flow chart but languages such as java, c#, or basic are also welcome. c# is most preferred as this is the language I'm working in&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So as to the question why I'm doing this, If you haven't already guessed&lt;br /&gt;
I want to find out all the possible moves a player can make with any of his/her active pieces in a ludo game.&lt;br /&gt;
So If there's is a more efficient way of doing it other than the algorithm I stated above, Please share&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392245/392245/permutation-and-combination--algorithm-please-help/</guid>
      <pubDate>Fri, 12 Jun 2009 09:55:42 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Algorithm for generating continents/islands</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/391892/391892/algorithm-for-generating-continentsislands/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
currently i'm programming a mapeditor. i want to include some nice scripts, which generate some islands/continents or other interesting shapes. the algorithm only need to tell me, if to set land on the field (x,y) or not. But in that direction i have no experience.&lt;br /&gt;
&lt;br /&gt;
so if you can tell me some good internetsites or names of algorithm which can be used for this, i have a point at which i can start with the search. some example are also welcome, the programming-speech doesn't plays any role to me. so pseudocode will also be good.&lt;br /&gt;
&lt;br /&gt;
i'm thankfull for every help.&lt;br /&gt;
&lt;br /&gt;
yours&lt;br /&gt;
ralfonso</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/391892/391892/algorithm-for-generating-continentsislands/</guid>
      <pubDate>Wed, 03 Jun 2009 13:33:20 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Divide Set Algorithm to recive the vector (1,1,...,1)</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/391122/391122/divide-set-algorithm-to-recive-the-vector-111/</link>
      <description>So I'm stuck at this question, the goal is to find a lower bound.&lt;br /&gt;
I have a set of natural numbers, each action is&lt;br /&gt;
choose a number&amp;gt;1 (refer as k) and divide the whole set (the vector (a1,a2,...,an) by this k then insted of the number's value enter this formula: i/k+i%k (Div+Mod)&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
(13,5,8,40) for k=4 we get: (13/4+13%4,5/4+5%4,8/4+8%4,40/4+40%4)&lt;br /&gt;
(4,2,2,10) then repeat the action.&lt;br /&gt;
&lt;br /&gt;
-We know the higest number has value N&lt;br /&gt;
I need a lower bound of minimum action (If it helps i know the upper bound is 2*sqrt(N))&lt;br /&gt;
&lt;br /&gt;
It's really urgent!!!&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
Rom.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/391122/391122/divide-set-algorithm-to-recive-the-vector-111/</guid>
      <pubDate>Sun, 17 May 2009 23:27:03 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Single Destination shortest path</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/390740/390740/single-destination-shortest-path/</link>
      <description>hi...i am used to and i ve implemented single source shortest path dijstra's algorithm...&lt;br /&gt;
shortest path from start to all the vertices...&lt;br /&gt;
&lt;br /&gt;
but for same destination from many sources  it will be single destination shortest path...&lt;br /&gt;
but how do i modify single source to single destination....&lt;br /&gt;
&lt;br /&gt;
any help plzzzzz.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/390740/390740/single-destination-shortest-path/</guid>
      <pubDate>Sun, 10 May 2009 02:16:09 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Best combination of sets algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/390464/390464/best-combination-of-sets-algorithm/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I need help with creating an algorithm to solve the problem below in the most efficient manner (efficiency in this case means low processing, not memory)&lt;br /&gt;
&lt;br /&gt;
(Disclaimer: I studied discrete maths as part of my university course, but this was many years ago and I have forgotten most of the correct syntax. Sorry!)&lt;br /&gt;
&lt;br /&gt;
Imagine we have&lt;br /&gt;
&lt;br /&gt;
Set A (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2
0)&lt;br /&gt;
Set B (3,3,4,5,5,5,5,5,6,6,7,8,12)&lt;br /&gt;
Set C&lt;br /&gt;
(&lt;br /&gt;
          Set C.A (1,2) = 10&lt;br /&gt;
          Set C.B (1,4,3) = 15&lt;br /&gt;
          Set C.C (3,4,5) = 20&lt;br /&gt;
          Set C.D (3,3,4,5) = 25&lt;br /&gt;
          Set C.E (5,6) = 10&lt;br /&gt;
          Set C.F (5,5,6) = 10&lt;br /&gt;
          Set C.G (3,3,4,5,5,5,5,5,6,6,7,8,12) = 5&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
B is a subset of A&lt;br /&gt;
C is a subset of A&lt;br /&gt;
&lt;br /&gt;
I need to find&lt;br /&gt;
          1) Which C are in B&lt;br /&gt;
          2) What is the best combination of C. (Best means the biggest value i.e. C.A is worth 10, C.B is worth 15 etc)&lt;br /&gt;
&lt;br /&gt;
When a C is found in B; B is to be reduced by C (e.g. if C.G is applied to B, there will nothing left in B)&lt;br /&gt;
A single instance of C can be applied to B a number of times (e.g. C.E above is in B twice)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assume I have done 1 and the method is called GetApplicableSets(SetB) and the example above would return C.C, C.D, C.E, C.F, C.G&lt;br /&gt;
&lt;br /&gt;
How do I do 2?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/390464/390464/best-combination-of-sets-algorithm/</guid>
      <pubDate>Wed, 06 May 2009 01:38:53 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>pattern matching algoritham</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/389661/389661/pattern-matching-algoritham/</link>
      <description>I  have a text like following pattern&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="color: Blue;"&gt;xxzzdggjkllkxxzzzzxxzzxz&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
And also two pattens like &lt;span style="color: Red;"&gt;xx&lt;/span&gt; and &lt;span style="color: Red;"&gt;zz&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I need to find longest possible string which include above two patterns.&lt;br /&gt;
&lt;br /&gt;
So any one can post a algorithm for this it is very help full for me.&lt;br /&gt;
&lt;br /&gt;
please help me .......&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/389661/389661/pattern-matching-algoritham/</guid>
      <pubDate>Wed, 22 Apr 2009 21:51:21 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>errors in pseudocode help</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/389254/389254/errors-in-pseudocode-help/</link>
      <description>I tried using Actors but it isn't working. It says the words "write" and/or "read" aren't declared. Im writing this for CH is there any other way I can do it, or other words? (We've been using cout and cin things)?&lt;br /&gt;
&lt;br /&gt;
Now that you have been working on Ch programs for the past few weeks, you should have become more familiar with the process of translating a problem/solution description into code. In this lab, you are given a problem statement that makes use of the programming elements learned over the past few weeks. You are expected to devise an algorithm to solve this problem and translate it into code. You are expected to work on your own. Some hints are given at the end of this handout to help you with this process. Remember that your code will not look like everyone else’s.&lt;br /&gt;
&lt;br /&gt;
Write a program that inputs an even integer from the user (we will refer to this as x in the rest of the handout) and outputs all even numbers between zero and the input number (inclusive).&lt;br /&gt;
&lt;br /&gt;
Hints: &lt;br /&gt;
&lt;br /&gt;
1. Remember to declare needed variable(s). How many variables do you need and of what type?&lt;br /&gt;
&lt;br /&gt;
2. The problem statement is essentially asking you to print the number sequence 0 2 4 6 … x. What is the relationship between each number in the sequence and the next number?&lt;br /&gt;
&lt;br /&gt;
3. You will need a while loop to generate the sequence of number and output them. What should be the loop condition if you want to stop after you have printed x? &lt;br /&gt;
&lt;br /&gt;
Save your program file as lab12.ch in your H drive. Test your program and be sure that it prints the correct sequence of numbers. Transfer a copy of the finalized version of your program to your Submissions folder.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/389254/389254/errors-in-pseudocode-help/</guid>
      <pubDate>Wed, 15 Apr 2009 14:27:57 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>HELP WITH THIS PSEUDOCODE PLEASE!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/389128/389128/help-with-this-pseudocode-please/</link>
      <description>Can anyone help me write a pseudocode for this problem please?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Write a program that inputs an even integer from the user (we will refer to this as x in the rest of the handout) and outputs all even numbers between zero and the input number (inclusive).&lt;br /&gt;
&lt;br /&gt;
Hints: &lt;br /&gt;
&lt;br /&gt;
1.	Remember to declare needed variable(s). How many variables do you need and of what type?&lt;br /&gt;
&lt;br /&gt;
2.	The problem statement is essentially asking you to print the number sequence 0  2  4  6  … x. What is the relationship between each number in the sequence and the next number?&lt;br /&gt;
&lt;br /&gt;
3.	You will need a while loop to generate the sequence of number and output them. What should be the loop condition if you want to stop after you have printed x? &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/389128/389128/help-with-this-pseudocode-please/</guid>
      <pubDate>Tue, 14 Apr 2009 09:47:03 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>calculating MFCC</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/388601/388601/calculating-mfcc/</link>
      <description>Hi. I'm not sure if this should go here or the algorithm forum, so apologies if it's in the wrong forum. I'm trying to find the MFCC of my mp3 files. I'm using Fmod (although I'd rather use Bass but I'm not sure how to get the frequency of the whole song, in non-realtime). I get the frequency and now I'm following wikipedia's article on MFCC.&lt;br /&gt;
Here's my psuedocode for it: &lt;br /&gt;
1) Take the Fourier transform of (a windowed excerpt of) a signal. &lt;br /&gt;
Code:&lt;br /&gt;
I use getSpectrum with the FMOD_DSP_FFT_WINDOW_TRIANGLE parameter &lt;br /&gt;
&lt;br /&gt;
2)Map the powers of the spectrum obtained above onto the mel scale, using triangular overlapping windows. &lt;br /&gt;
&lt;br /&gt;
I go through the spectrum array and use this equation on each value: &lt;br /&gt;
Code:&lt;br /&gt;
mel = 1127.01048log e (1+f/700)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take the logs of the powers at each of the mel frequencies. &lt;br /&gt;
I then go through the new mel-array and take the log of each : &lt;br /&gt;
Code:&lt;br /&gt;
mLog[i] = (Math.log(melArray[i]))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take the discrete cosine transform of the list of mel log powers, as if it were a signal. (Then find amplitude of DCT result) &lt;br /&gt;
I'm not sure what I do here. How do I calculate the DCT? &lt;br /&gt;
&lt;br /&gt;
Am I on the right track?&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/388601/388601/calculating-mfcc/</guid>
      <pubDate>Sun, 05 Apr 2009 02:58:28 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>dynamic programming problem</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/388548/388548/dynamic-programming-problem/</link>
      <description>Hi I have a to solve this problem with dynamic programming&lt;br /&gt;
We have system that generates sequence of chars, system can be only in one stat at a time. If system is in the state qi in the next step he goes to state qj with probability pij while generating char aij.&lt;br /&gt;
As input we have:&lt;br /&gt;
number n&lt;br /&gt;
matrix p(matrix of probabilities), its size is nxn&lt;br /&gt;
matrix a(matrix of chars), also nxn&lt;br /&gt;
sequence of chars&lt;br /&gt;
I need to find most probable way how was the sequence of chars in the input created. I just need some hints, how to solve it with dynamic programming, if I could use tree, it would be easy, bet I cant.&lt;br /&gt;
Thanks for all advices&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/388548/388548/dynamic-programming-problem/</guid>
      <pubDate>Fri, 03 Apr 2009 14:25:10 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Language recognition using Neural Networks</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/388215/388215/language-recognition-using-neural-networks/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
We have to select a project for our 3rd year engineering, and we have decided to implement a system which recognizes the language (from a sentence, paragraph, or a complete long text). We aim to do that using neural networks.&lt;br /&gt;
&lt;br /&gt;
I am absolutely new to 'world' of neural networks. Is the project I have described above feasible? I have absolutely no idea of neural networks currently. We intend to 'train' the network using passages of languages first (English, Spanish, French etc), and then make it ready for recognition - is this how things work? Can someone please guide us further how to proceed?&lt;br /&gt;
&lt;br /&gt;
We can use any software to implement this - MATLAB, C/C++, Java.. What would be the best tool for a newbie?&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;br /&gt;
&lt;br /&gt;
PS: Pardon me if this post is in the wrong forum, but I could not find any forum on PH dedicated to neural networks.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/388215/388215/language-recognition-using-neural-networks/</guid>
      <pubDate>Sat, 28 Mar 2009 22:39:14 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Priority Queue Algorithms</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/387763/387763/priority-queue-algorithms/</link>
      <description>Hey guys, my first post here :) greetings!! I'm searching for Recent Algorithms to maintain elements in a priority queue... i have a project to make... can you help me??&lt;br /&gt;
&lt;br /&gt;
thank you all&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/387763/387763/priority-queue-algorithms/</guid>
      <pubDate>Sat, 21 Mar 2009 07:56:17 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>crossword solving algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386968/386968/crossword-solving-algorithm/</link>
      <description>HI all&lt;br /&gt;
&lt;br /&gt;
is there any good crossword solving algorithm?&lt;br /&gt;
&lt;br /&gt;
I have matrix of (rows x cols) and a dictionary of words to be filled in the matrix. This words have to fit in horizontal and vertical direction.&lt;br /&gt;
&lt;br /&gt;
thx&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386968/386968/crossword-solving-algorithm/</guid>
      <pubDate>Sun, 08 Mar 2009 08:38:22 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>a cd is bootable or not?</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386773/386773/a-cd-is-bootable-or-not/</link>
      <description>Hi everyone .&lt;br /&gt;
&lt;br /&gt;
Can anyone help me about how to determine a cd is bootable or not with using java? or any other programming language. &lt;br /&gt;
&lt;br /&gt;
thanx.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386773/386773/a-cd-is-bootable-or-not/</guid>
      <pubDate>Wed, 04 Mar 2009 13:35:56 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Edit distance recomputation</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386681/386681/edit-distance-recomputation/</link>
      <description>Dear participants,&lt;br /&gt;
&lt;br /&gt;
I have a question concerning effective re-computations of an edit distance. What I mean is the following:&lt;br /&gt;
&lt;br /&gt;
suppose we have two strings A, B and a value d = edit_dist(A,B) computed with an algorithm like the Levenshtein algorithm. Now we change A into A' using one edit operation i.e. we insert, delete or change one character in A. Is there a way to avoid a complete recomputation d' = edit_dist(A',B)? &lt;br /&gt;
&lt;br /&gt;
I'd be appreciate a lot if someone can point to an article or book where this problem is treated.&lt;br /&gt;
&lt;br /&gt;
Thx&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386681/386681/edit-distance-recomputation/</guid>
      <pubDate>Tue, 03 Mar 2009 09:17:36 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>finding two consecutive zeros in a bit string</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386664/386664/finding-two-consecutive-zeros-in-a-bit-string/</link>
      <description>Hi,&lt;br /&gt;
Please help to design an algorithm that determines if a bit string of length n contains two consecutive zeros.  It has to solve the problem by examining fewer than n bits.  Or I need to give an adversary strategy to force algorithm to examine every bit. n = 2,3,5.&lt;br /&gt;
Thanks for help&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386664/386664/finding-two-consecutive-zeros-in-a-bit-string/</guid>
      <pubDate>Tue, 03 Mar 2009 05:54:35 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>voronoi diagram on a sphere</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386558/386558/voronoi-diagram-on-a-sphere/</link>
      <description>hi,&lt;br /&gt;
&lt;br /&gt;
does anyone out there happen to know how one would go by building a voronoi diagram on a sphere? The "sites" of the diagram are on the unit sphere. Some effort has been put into the problem, and I have actually three ideas on how to proceed :&lt;br /&gt;
&lt;br /&gt;
1/ With Fortune's algorithm&lt;br /&gt;
I tried to transpose Fortune's line-sweep algorithm to the surface of a sphere, but I got stuck on a mathematical problem, some formula that is supposed to define the surface that separates space in two, all points of space closer to a given point on the sphere on one side, and all points closer to circle on the sphere (not a great circle, just any circle - an intersection between the sphere and a plane). It looks like this :&lt;br /&gt;
Ax + By + Cz + Dsqrt(1-y^2) = 0&lt;br /&gt;
To implement the algorithm, I need to determine an intersection between two such things and I really don't know how to manipulate them (the sqrt(1-y^2) term being the problem).&lt;br /&gt;
&lt;br /&gt;
2/ Using a Delaunay triangulation instead&lt;br /&gt;
It seems that it would be easier to implement on a sphere since the math is more intuitive, at least in the incremental algorithms I've seen. But even though the algorithm would be of the same average complexity as Fortune's algorithm - O(n log(n)) - it seems it would be a lot slower given all the intersection tests required.&lt;br /&gt;
&lt;br /&gt;
3/ Using Fortune's algorithm, but this time on a 2D stereographic projection of the sphere&lt;br /&gt;
I think the idea is cool but I need some proof that it would give the same output. The stereographic projection doesn't preserve distances which is kind of a central theme in Voronoi diagrams. On the other hand, I get the feeling that it should work on a Delauney triangulation, and if it works for one, it works for the other... I just lack the math "intuition" to prove one way or the other.&lt;br /&gt;
&lt;br /&gt;
Well, I hope someone can help me out, and I hope this is posted in the right place.&lt;br /&gt;
cheers&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386558/386558/voronoi-diagram-on-a-sphere/</guid>
      <pubDate>Sun, 01 Mar 2009 19:27:49 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Need your intelligence and knowledge!!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386539/386539/need-your-intelligence-and-knowledge/</link>
      <description>Hi to all!&lt;br /&gt;
I search an algorithm to that problem:&lt;br /&gt;
You have N rectangles N is may be between 0 and 1000. You must arrange them with the least area. You are given the dimensions of all rectangles (may be square you know from math all squares are rectangle ).&lt;br /&gt;
and they want the minimum area includes all rectangles and coordinates of left corner of each rectangle assuming (0,0) the upper left corner.&lt;br /&gt;
Thans for your help&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386539/386539/need-your-intelligence-and-knowledge/</guid>
      <pubDate>Sun, 01 Mar 2009 11:00:42 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Help me figure out this pseudocode!!</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/386362/386362/help-me-figure-out-this-pseudocode/</link>
      <description>You are the owner of a vegetarian pizzeria and you want to write a program to allow the customer to order only ONE pizza online. You will prompt the customer for his/her name, pizza size being order (small, medium, or large), and pizza type being ordered (veggie or cheese), and then input this data. You are to output the customer name, pizza size, pizza type, and cost of pizza back to the customer. For a veggie pizza, small costs $10, medium costs $12.25, and large costs $14.50. For a cheese pizza, small costs $7, medium costs $8, and large costs $9. Be sure to validate the size and type of pizza, and if the data is invalid, output an appropriate message to the customer.&lt;br /&gt;
&lt;br /&gt;
I don't understand how to write this as a pseudocode. This is not my homework. This is an extra problem I'm trying to do on my own to understand how to do other kind of pesudocode's problems.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/386362/386362/help-me-figure-out-this-pseudocode/</guid>
      <pubDate>Wed, 25 Feb 2009 18:29:09 -0700</pubDate>
      <category>Algorithms</category>
    </item>
  </channel>
</rss>