10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

Figure shows two linked list in memory where each node of the both list are<br />

stored in the same linear array INFO and LINK.<br />

INFO LINK<br />

The information part of a node may be recorded with more than one data item.<br />

In such a case, the data should be stored in a collection of parallel arrays.<br />

3. HEAP REPRESENTATION OF A PRIORITY QUEUES:<br />

A heap is a complete binary tree and with the additional property‐ the root<br />

element is either smallest or largest from its children if root element of the heap<br />

is smallest from its children. It is known as min heap. If the root element of the<br />

heap is largest from its children, it is known as max heap.<br />

A priority queues can be resented <strong>using</strong> min or max heap.<br />

A priority queues having highest priority for lower number can be represented<br />

<strong>using</strong> min heap, and a priority queues having highest priority for higher number<br />

can be represented <strong>using</strong> max heap.Hence, the element of the priority queues<br />

to be processed next in the root node of the heap.If we compare the effort in<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 151 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!