Essential discrete mathematics based algorithms and applications in a high level OOP and optimized manner