About 19,800 results
Open links in new tab
  1. Python 中 `heapify` 的功能与使用详解 — geek-blogs.com

    Sep 27, 2025 · 本文详细介绍了 Python 中 heapify 函数的基础概念、使用方法、常见实践以及最佳实践。 heapify 函数可以将一个列表转换为堆结构,堆在优先队列、堆排序等场景中非常有用。

  2. 为什么堆化 heapify () 只用 O (n) 就做到了? - 知乎

    heapify () 前面两篇文章介绍了什么是堆以及堆的两个基本操作,但其实呢,堆还有一个大名鼎鼎的非常重要的操作,就是 heapify () 了,它是一个很神奇的操作, 可以用 O (n) 的时间把一个乱序的数组变 …

  3. python中heapq堆的讲解_heapq.heapify (q)-CSDN博客

    Mar 20, 2020 · 最大堆,树种各个父节点的值总是大于或等于任何一个子节点的值。 一般使用二叉堆来实现优先级队列,它的内部调整算法复杂度为logN。 堆是一个二叉树,heapq堆数据结构最重要的特征 …

  4. 基础堆排序 - 菜鸟教程

    我们之前构造堆的过程是一个个数据调用 insert 方法使用 shift up 逐个插入到堆中,这个算法的时候时间复杂度是 O (nlogn),本小节介绍的一种构造堆排序的过程,称为 Heapify,算法时间复杂度为 O (n)。

  5. heapq — Heap queue algorithm — Python 3.14.2 documentation

    2 days ago · To create a heap, use a list initialized as [], or transform an existing list into a min-heap or max-heap using the heapify() or heapify_max() functions, respectively.

  6. Java 中的 Heapify:概念、使用与最佳实践 - javaguidepro.com

    Sep 19, 2025 · 本文将详细介绍 `heapify` 在 Java 中的基础概念、使用方法、常见实践以及最佳实践,帮助读者深入理解并高效使用这一重要技术。

  7. python的heaplify函数_mob64ca12e08acf的技术博客_51CTO博客

    Feb 19, 2025 · 在 Python 中, heapify 函数是一个非常实用的工具,尤其是对于那些需要高效优先级队列或排序算法的场景来说。 heapify 函数将一个普通的列表转化为一个堆(heap),这是一个特殊的完 …

  8. 堆化 · Heapify - 九章算法

    Given an integer array, heapify it into a min-heap array.For a heap array A, A 0 is the root of heap, and for each A i, A i * 2 + 1 is the left child of A i and A i * 2 + 2 is the right child of A i.

  9. Heapify | ProCoding

    The terms "heapify", "heapify down"and “heapify up”are related but refer to different concepts or processes within the context of heaps, specifically in how an array is organized to maintain heap …

  10. 【算法日积月累】10-堆排序、heapify、原地堆排序 - 简书

    Mar 30, 2019 · Heapify 是尝试将一整个数组构建成一个堆的方式,即通过调整自己,交换数组中的元素,就可以把自己整理成一个最大堆。