I am studying a data structures course in which we have given many assignments on constructing data structures (like trees, arrays, and linked lists).

In class template, what kind of notation should I write for these operators (::,->) and the others operators which are used in C++? Can anyone elaborate more about writing pseudo-code for object oriented programs?

  • 3
    $\begingroup$ There is no standard for pseudocode. Use anything you want, as long as its meaning is clear. $\endgroup$ – David Richerby Mar 30 '17 at 7:48
  • $\begingroup$ If there's some reason you care about C++, why not just use C++? That way you can actually test your code and there's no ambiguity. Even if you don't write a full program, I see no reason to use pseudo-code. If you aren't tied to C++, then I recommend using a language with a more concise syntax e.g. Python. I personally think pseudo-code is a bad idea in general, though certainly there are situations, like at a blackboard, where abbreviating real code makes sense. $\endgroup$ – Derek Elkins Mar 30 '17 at 9:42

Pseudocode has no formal definition. Use whatever notation you want, as long as it is either self-explanatory (even for people unaware of C++) or explained in the text.

I suggest looking at several textbooks and papers to see what the "industry standard" is, and using something similar.

  • $\begingroup$ you probably right, i should go through some text books. but i found a website where almost every thing converted into pseudo-code from c++ program. i know that there is no standard for pseudo-code. but i asked this question to know about standard pseudo-code for Object Oriented Programming (like you said industrial type of standard) $\endgroup$ – muneeb_ahmed Apr 1 '17 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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