Optimal Policies In Deterministic And Stochastic Inventory Models: Theory And Applications