I have a line of binary codes such as 1 1 1 0 0 0 1 1 1
I'd like to change the number of consecutive 0s to be even.
is there any good algorithm in C?
Thanks
You should cleanup your mind.
- An algorithm belongs to the design (phase #2 of a project life). It
has nothing to do with an implementation language. It can be written in
plain <select your spoken language> or in algorithmic langage (AFAICT,
no real standard, but a kind of Pascal is close enough).
- Once you have an algorithm working on a sheet of paper (could be an
electronic one, let's be modern...), you switch to phase #3 (Coding and
test). You translate it into your implementation language (Asm, C, C++,
X--, Y** whatever).
FYI:
Project life:
#1 Specifications (what ?)
#2 Design (how-to ?)
#3 Coding and unit-test (implementation)
#4 Integration (glue the all thing and make it work)
#5 Validation (Does the thing comply with the specs ?)
--
Emmanuel
The C-FAQ:
http://www.eskimo.com/~scs/C-faq/faq.html
The C-library:
http://www.dinkumware.com/refxc.html
"C is a sharp tool"