Heap is also called Left Complete binary tree. i.e Binary tree with some of rightmost node removed.

It is very efficient for priority Queue implementation.

####

###

####

It is very efficient for priority Queue implementation.

MaxHeap |

####
__Heap Type:__

__Minimum Key Heap:__Root node is always minimum.__Maximum key Heap:__Root node is always maximum.

It can Easily Implement in array and It will be more easier to implement if we take 1th index of array as root of heap( leave 0th index of array ).

**Then**

**Parent of i'th Node is = [i/2] {it is flore of i//2}****Left child of i'th Node is = 2*i****Right child of i'th Node = 2*i +1**

### Heapify(A,i)

is a function that used to maintain heap property of left complete binary tree.

A <= Array

i <= Index of node that need rearrangement to satisfy make array A a heap.

###
**This C++ Program Demonstrate use of Hepify **

**//Maxheap****//Note this program first create complete binary tree then****//hepify it . but it does not hepify after each insertion****//but it can easily done by applying hepify after each insertion****#include<iostream>****#include<new>****using namespace std;****void hepify(int *heap,int i,int heapSize);****void Display(int heap[],int heapSize);****main(){****//initialise array of required heap size****int heapSize;****cout<<"Enter max element in heap :- "<<endl;****cin>>heapSize;****int *heap;****heap =new int[heapSize+1];****heap[0]=0;****//now insert all element in heap****//after that we hepify it****cout<<"Enter element of heap :"<<endl;****//int a;****for(int i=1;i<=heapSize;i++){****cin>>heap[i];****}****cout<<"\nInsert data to form complete binary tree :"<<endl;****//some rightmost child may not present at at last level of heap****Display(heap,heapSize);****// now balance heap****for(int i=heapSize/2;i>=1;i--){****hepify(heap,i,heapSize);****}****//After Balancing Heap****cout<<"\nAfter Balancing Complete binary tree"<<endl;****cout<<"such that it become a heap. ie after heapify :)"<<endl;****Display(heap,heapSize);****}****void hepify(int *heap,int i,int heapSize){****int left=2*i; //index of left child of ith node****int right=left+1; //index of right child of ith node****int largest;****//find index of largest among (ith node and its left and right child)****if(left<=heapSize && heap[left]>heap[i])****largest=left;****else****largest=i;****if(right<=heapSize && heap[right]>heap[largest])****largest=right;****//now swap largest with ith node****if(largest !=i){****int temp =heap[i];****heap[i]=heap[largest];****heap[largest]=temp;****hepify(heap,largest,heapSize);****}****}****void Display(int heap[],int heapSize){****cout<<"Heap !!! >>> ";****for(int i=1;i<=heapSize;i++){****cout<<heap[i]<<" ";****}****cout<<endl;****}**

I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Data Science with Python , kindly contact us http://www.maxmunus.com/contact

ReplyDeleteMaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.

For Demo Contact us.

Sangita Mohanty

MaxMunus

E-mail: sangita@maxmunus.com

Skype id: training_maxmunus

Ph:(0) 9738075708 / 080 - 41103383

http://www.maxmunus.com/

ReplyDeleteI have read your blog and I gathered some needful information from your blog. Keep update your blog. Awaiting for your next update.

Php course in chennai

Mesmerized article written on this blog with other relevant information. It is straight to the point that how we can improve our skills as well as how we can be represented to a new stream of professionalism.

ReplyDeleteDell Media Tape Cartridge for LTO6

Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.

ReplyDeletecreate your own shirt

Share great information about your blog , Blog really helpful for us . We read your blog , share most useful information in blog . Thanks for share your blog here .

ReplyDeleteรักษาไมเกรน

I welcome all the suggestion mentioned in this blog related to new learning skills. It is definitely going to help me to adopt new exited way of learning. I think, others will also feel helpful this blog for their needs.

ReplyDeleteexness คือ

Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.

ReplyDeleteexness ข้อดี

Nice to read this publication on this blog. As far as I can see, this is a very basic question for everyone indeed. Its my personal opinion and I am completely agreed with the subject used here

ReplyDeleteโปรโมชั่น เอไอเอส

creativity of writer is purely impressive. It has touched to the level of expertise with his writing. Everything is up to the mark. Written perfectly and I can use such information for my coming assignment.

ReplyDeleteFBS โกงหรือไม่

This is really nice to read content of this blog. A is very extensive and vast knowledgeable platform has been given by this blog. I really appreciate this blog to has such kind of educational knowledge.

ReplyDeleteเสาเข็มไอ

This is really nice to read content of this blog. A is very extensive and vast knowledgeable platform has been given by this blog. I really appreciate this blog to has such kind of educational knowledge.

ReplyDeleteสรรพคุณเห็ดหลินจือ

Sometime it becomes very hard to find a well written and well established bog which give you correct and useful information. However, I found this blog and got some relevant information which are really helpful for me.

ReplyDeleteair bubble

Mesmerized article written on this blog with other relevant information. It is straight to the point that how we can improve our skills as well as how we can be represented to a new stream of professionalism.

ReplyDeleteโรงพิมพ์ออฟเซ็ท

Enthusiastic words written in this blog helped me to enhance my skills as well as helped me to know how I can help myself on my own. I am really glad to come at this platform.

ReplyDeleteการ เล่น forex

I constantly like to read a top quality content having accurate info pertaining to the subject and the exact same thing I found in this article. Nice job.

ReplyDeleteเช่า จอ

An author must have a vast knowledge of vocabulary. The dictionary of a writer must be full of new english vocabulary to make their work more attractive. Use of new words makes their work more valuable and graceful.

ReplyDeleteE-Currency

Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.

ReplyDeleteสอน เล่น forex

Hey, It really is incredibly fantastic and informative website. Good to discover your site Very well article! I’m simply in love with it.

ReplyDeleteเรซูเม่

I enjoyed reading this blog. in my opinion, everything was perfectly written there as well as few small tips are also can be taken as healthy suggestion. Descriptive informative content written in this blog is very useful.

ReplyDeleteforex ไทย

our enthusiasm leads you beyond the limits. When you feel yourself enthusiastic that’s the time you can cross any limit. You seek to get perfection by using the ability of work. Read such motivational article and definitely it will help you to know new facts.

ReplyDeleteLenovo System x3500 M5

The site is really beneficial for everyone to know about this topic. I think if you read blog than you will get some more information from blog. This is really useful blog.

ReplyDeletepueraria mirifica

Now day, everything is going to find a new but well settled and successful stream for their career. When I came to this blog, I really impressed by all the knowledge points mentioned here. Thank you for this assistance.

ReplyDeleteขาย อะไร ดี

Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.

ReplyDeleteepoxy resin คือ

Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.

ReplyDeleteใบ อนุญาต เครื่องมือ แพทย์

Really inspirational to hear someone pursuing their dreams and becoming successful instead of following the traditional path. I have read your article about This topic. I think it's good and impressed to know your service. Thanks for share this Information.

ReplyDeleteราคาแอร์

Enthusiastic beginning is very common in every sector when anyone enters into a new world. But it is very hard to keep such enthusiasm for a long time after huddles come out from invited sources. Read this blog and know more about this topic.

ReplyDeleteforex demo

I am delighted to come to such a wonderful blog. I am really very impressed to read from top to bottom. I read every single line and understand the essence of every single word. I appreciate all efforts.

ReplyDeleteWeb Design

Graceful written content on this blog is really useful for everyone same as I got to know. Difficult to locate relevant and useful informative blog as I found this one to get more knowledge but this is really a nice one.

ReplyDeleteรับวาดรูปการ์ตูน

Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.

ReplyDeleteโปรโมชั่น iphone

Detailed and descriptive articles written in this blog is really very helpful for me as well as for other who seeking such kind of knowledge. It is definitely going to become useful in coming future.

ReplyDeleteออกแบบกระเป๋าผ้า

Share great information about your blog , Blog really helpful for us . We read your blog , share most useful information in blog . Thanks for share your blog here .

ReplyDeleteกระเป๋าถุงผ้า

This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.

ReplyDeleteAffiliate คืออะไร

Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.

ReplyDeleteหุ้น forex

Hello, I also would like to comment over all the points mentioned in this blog. I agree with essence of few point but somewhere I found myself on other place. I hope, there might little opinion of others as well.

ReplyDeleteเรียน a level ที่ไหนดี

Really inspirational to hear someone pursuing their dreams and becoming successful instead of following the traditional path. I have read your article about This topic. I think it's good and impressed to know your service. Thanks for share this Information.

ReplyDeleteเห็ด หลิน จื อ แดง ราคา

That’s what I was looking for. I am talking about all topics bundled in this blog. They all are really very useful for me as well as for my team. We are definitely going to use its highlighted information.

ReplyDeleteฟ อ เร็ ก

Sometimes is becomes very hard to take appreciation for your hard work. But sometime only few technical point makes your work worthwhile. Suggestion under this blog is quite good.

ReplyDeletecanvas tote

Your blog is very informative. Eating mindfully has been very hard for people these days. It's all because of their busy schedules, work or lack of focus on themselves. As a student I must admit that I have not been eating mindfully but because of this I will start now. It could help me enjoy my food and time alone. Eating mindfully may help me be aware of healthy food and appreciating food.

ReplyDeleteโปร Advice

This is really nice to read content of this blog. A is very extensive and vast knowledgeable platform has been given by this blog. I really appreciate this blog to has such kind of educational knowledge.

ReplyDeleteขาย อะไร ดี ใน เน็ต ลงทุน น้อย กํา ไร เยอะ

Wow! This is the perfect blog I am looking this type of blog its awesome blog here , share great information about this topic. This informative blog helps many readers with their decision-making regarding the situation. Great articles and will look forward for more!

ReplyDeleteโคม ไฟ ถนน

This blog is truly useful to convey overhauled instructive undertakings over web which is truly examination. I discovered one fruitful case of this truth through this blog. I will utilize such data now.

ReplyDeleteโคม ไฟ โรงงาน

This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.

ReplyDeleteเร ซิ่น

This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.

ReplyDeleteเร ซิ่น

Share great information about your blog , Blog really helpful for us . We read your blog , share most useful information in blog . Thanks for share your blog here .

ReplyDeleteวเตอร์สอนที่บ้าน

Share great information about your blog , Blog really helpful for us . We read your blog , share most useful information in blog . Thanks for share your blog here .

ReplyDeletea level

Professionally written blogs are rare to find, however I appreciate all the points mentioned here. I also want to include some other writing skills which everyone must aware of.

ReplyDeletePut Option คือ

It become an attractive part of a blog when author uses indirect speech while writing a blog. It shows your creative mind as well as make your written essay different from others.

ReplyDeleteForex Bitcoin คือ

Wow, a great code. I dont know the function lol

ReplyDeleteMobil SUV Terbaru

An outstanding share! I've just forwarded this onto a co-worker who has been doing a little research on this. And he actually bought me dinner because I discovered it for him... lol. So let me reword this.... Thank YOU for the meal!! But yeah, thanx for spending time to discuss this issue here on your web page.

ReplyDeletecây treo quần áo

I blog quite often and I genuinely thank you for your information. Your article has truly peaked my interest. I will book mark your blog and keep checking for new information about once per week. I opted in for your Feed too.

ReplyDeletebàn ăn gỗ giá rẻ

This is a topic which is near to my heart... Best wishes! Exactly where are your contact details though?

ReplyDeletegiường ngủ đẹp