Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (20 sloc) 790 Bytes
\Question\label{ex:Uniq q1} Write a Go program that mimics the function
of the Unix \prog{uniq} command. This program should work as follows,
given a list with the following items:
'a' 'b' 'a' 'a' 'a' 'c' 'd' 'e' 'f' 'g'
it should print only those item which don't have the same successor:
'a' 'b' 'a' 'c' 'd' 'e' 'f'
Listing \ref{src:uniq} is a Perl implementation of the algorithm.
\lstinputlisting[label=src:uniq,caption=uniq(1) in Perl,language=Perl]{ex-communication/src/}
\Question The following is a uniq implementation in Go.
\lstinputlisting[caption=uniq(1) in Go]{ex-communication/src/uniq.go}
Jump to Line
Something went wrong with that request. Please try again.