Data Structures And Algorithms

Showing posts with label dutch flag. Show all posts
Showing posts with label dutch flag. Show all posts
Sunday, August 28, 2011

a1a2a3....anb1b2b3....bn to a1b1a2b2a3b3....anbn

›
Problem: Convert a1a2a3....anb1b2b3.....bn to a1b1a2b2a3b3.....anbn in O(n) time and O(1) space Solution: [b]       a  b  c d e 1 2 3 ...
1 comment:
›
Home
View web version
Powered by Blogger.