0

I am creating a list with the elements of another list. I want to make sure about two things. First that the list is made from another list and second the size of list changes. Is the following representation good enough ?

n ∈ {2,3,4}
new_list = [list[1], ... , list[n]]

How can I represent algorithmically that I create the "new_list" with elements of "list" without the dots ?

abpar
  • 61
  • 9
  • "Good enough" - it is so subjective. Anything (pseudo-code) a person can understand is good enough for that person. If you are not sure, or want to increase readability, just write a comment. Don't worry too much about notation (except you want to publish into a journal/book). It is for usage, and it is not a law, is it? :) – javaLover Mar 30 '17 at 08:28
  • I want to publish into an article and I was wondering the most clear way to represent such list. If it is pseudo code, I thing it's understandable but will it be different in algorithmic representation, I was not sure. Thanks ! – abpar Mar 30 '17 at 08:42

1 Answers1

0

There is no standard of pseudo-code. (I am glad there isn't.)

Therefore, I think it is vastly up to you to imagine what is good/bad.

Here are some rough conventions, but none address what you asked directly :-

Therefore, I will use my opinion : the pseudo-code you show looks OK for me.
Just be sure that your article uses consistent notation.
(use same symbol/pattern to denote the same thing)

I hope that this solution is good enough for you.

Community
  • 1
  • 1
javaLover
  • 6,347
  • 2
  • 22
  • 67