Implementations of some trivial algos and coding problems on java