We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# 删除堆顶元素后, 交换堆尾和空堆顶的位置并实现元素的下沉 def percDown(self, i): while (i*2) <= self.currentSize: mc = self.minChild(i) if self.heapList[i] > self.heapList[mc]: temp = self.heapList[i] self.heapList[i] = self.heapList[mc] self.heapList[mc] = temp else: break
The text was updated successfully, but these errors were encountered:
还有 交换元素 每次弄个temp出来,怪麻烦的,既然已经 python了,为什么不a,b=b,a 呢?
Sorry, something went wrong.
我觉得这个python版的剑指offer可能是根据c++版改写过来的,所以有很多地方python都可以更简便,但是因为只是单纯的改写就没有了python的特点。
No branches or pull requests
The text was updated successfully, but these errors were encountered: