Introduction to the algorithm 6-2 D fork Heap

Source: Internet
Author: User

Questions: The D-Fork Heap is similar to the two-fork heap, but each of its non-leaf nodes has d children;

1) How to represent a D-fork heap in an array?

2) What is the height of a d fork heap containing n elements?

3) The effective implementation of Extract-max in D fork Heap is given, and the time complexity is expressed by D and N.

4) The effective implementation of insert in D fork Heap is given, and the time complexity is expressed by D and N.

5) The effective implementation of Increase-key (A, I, K) is given. When K < A[i], it will touch an error, otherwise execute a[i] = k,

and update the corresponding D fork maximum heap, use D and N to indicate its time complexity.

3) The Heap-extract-max algorithm is suitable for the D-Fork heap, but the problem is the max-heapify algorithm.

Here you need to compare the processed nodes with all of its children. So the time to run should be θ(dlogDn).

4) The Max-heap-insert algorithm also applies to this. The worst-case run time is the height of the heap, or θ(logDn).

5) Heap-increase-key algorithm, run time is O (logDn)

Introduction to the algorithm 6-2 D fork Heap

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.