Efficient algorithms in quantum query complexity