Comparative study of the (0001) and (0001¯) surfaces of ZnO