Implementation of reverse polish notation calculator