We present a top-k algorithm for retrieving tuples according to the order provided by a ranking function that belongs to a subclass of non-monotonic functions. The ranking functions are defined with the values where the maximum score is achieved. We test the proposed algorithm on various real and artificial data with varying variable ranges and different non-monotonic ranking functions.