Search code examples
jqueryhashhashmaphashtablepseudocode

pseudo code to print the values 'v' of Hash table separated by comma without using concatenation/buffering


Given that hashed object with unknown length 'n' with key/value pair 'k;v'

e.g {k1:v1, k2:v2,..kn-1,vn-1,kn:vn}

A function o(n) should output all value 'v' separated by comma (no buffering, no string concatenation)

How to include comma without buffering/concatenation?


Solution

  • repetitive prints?

    print v1
    print ", "
    print v2
    ...
    print "\n"
    

    etc

    if you meant "return" rather than "output" then I'm not so certain.