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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

queue<br />

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

1<br />

A(front)<br />

2<br />

B<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 143 ‐<br />

3<br />

C<br />

4<br />

D<br />

5<br />

E(rear)<br />

Delete A B(front) C D E(rear)<br />

INTRODUCTION TO CIRCULAR QUEUES :<br />

Delete B C(front) D E(rear)<br />

Delete C D(front) E(rear)<br />

Delete D E(rear)(front)<br />

Delete E(f=0,r=0)<br />

A circular queue is that queue in which the insertion of new element is done at the very<br />

first location of the queue. if the last location of queue is full , in other words if we have<br />

a queue denoted by Q which consist of n element then after inserting an element at last<br />

location of the array the next element will be inserted at very first location of the array.<br />

If a queue is full then no further elements can be inserted into it. So it is possible to<br />

insert new element iff some location in a queue are empty.<br />

A circular queue is a type of queue in which the first element comes just after the last<br />

element. it can be represented by loop of wire , in which the two ends of the wire are<br />

connected together.

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

Saved successfully!

Ooh no, something went wrong!