Algorithm( Words , Permutation ){
if ( words is empty ){
write permutation
}
for i <- 0 to words size
TemporaryWords = Words
TemporaryWords.erase( i , 1 )
TemporaryPermutation = Permutation
TemporaryPermutation += Words.at( i )
Algorithm( TemporaryWords , TemporaryPermutation )
end for
i not really familiar with this but i will try my best to do it myself as many as possible before i post and ask any senior tyr to correct me?
my program are done already
i complete with my own.
the problem is i not really expert to write in pseudo code although i know how to do in coding. that's the problem. haha
pseudo code is like writing the english translation of what the program does. Take this as an example:
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
using std::endl;
int main()
{
std::cout << "Hello, pseudo!" << endl;
int x = 5;
for(int i = 0; i < 10; ++i)
{
x += x*i;
}
}
using iostream
let endl be std::endl
function main nothing -> integer:
do
write "Hello, pseudo" and endl to the standard output stream
let x be an integer initialized to 5
for i in [0, 10):
do
add the product of x and i to x
end
end
And I also recommend some books which give pseudo code for the actual code.. for example "introduction to algorithms by Thomas H. Cormen). You may not need to buy this book.. you can get some pseudo code snippets from the book online like at google books etc..