0
$\begingroup$

If I stored the output for my algorithm as a data structure as a cell array. How can I express that when I am writing the pseudocode for my algorithm.

For example, I have a set of $n$ values like {2,4,6} and for each value, I run the algorithm and output a matrix.

I want to express in the pseudocode of my algorithm how I stored the matrix for each value and output these values and the matrices corresponding to it.

$\endgroup$
  • 1
    $\begingroup$ Is there something preventing you from just writing that down...? There is no standard for pseudocode; you can do as you please. $\endgroup$ – dkaeae Jul 17 '19 at 7:08
1
$\begingroup$

There are no set rules, but these type of details are sometimes omitted from the pseudocode listing. You might see something like

ALGORITHM(S, n): For i = 1 to n do S = ADD(S, i) EndFor

Then followed by something like "... the algorithm performs $\Theta(n)$ units of work assuming that the set $S$ is implemented as blah so that the addition of an element ADD(S,i) runs in blah time ..."

$\endgroup$
0
$\begingroup$

Most of the time, the author explicitly specifies any data structure used and it's operations, For example, if I am using a $ stack $ , I would specify that $ add/push $ operation adds an element to the stack and $ delete/pop/remove $ deletes an element from the stack. When not mentioned, it is advisable to use standard names used by popular programming languages.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.