Monday, August 27, 2007

insert and delete queue in C++ (queue operation)

insert and delete queue in C++ (queue operation)
=======================================


# include<iostream.h>
# include<conio.h>
# include<string.h>
# include<ctype.h>
# include<process.h>
# define size 10
class Queue
{
public: int rear, front;
int ch;
int q[size];

public: Queue()
{
rear = front = 0;
}
void Insert_queue();
void Delete_queue();
void Display_queue();

};

// Function to create queue
void Queue :: Insert_queue()
{
cout<<"\n Input the element :";
cin>>ch;
if(rear < size)
{
rear ++;
q[rear] = ch ;
if(front == 0)
front = 1;
}
else
cout<<"\nOverflow";
}

// Function to perform delete operation
void Queue :: Delete_queue() //char q[], char ch)
{
if (front == 0)
{
cout<<"\nUnderflow";
return ;
}
else
{
ch = q[front];
cout<<"\nElement deleted :"<<ch;
}
if(front == rear)
{
front = 0;
rear = 0;
}
else
front = front + 1;
}

// Output function
void Queue :: Display_queue() //char q[])
{
if (front == 0)
return;
for( int i = front ; i <= rear; i++)
cout<<" "<<q[i];
}

//Function main
void main()
{
Queue Q;
int k = 0;
char choice;

do
{
cout<<"\nInsert->i Delete->d Quit->q:";
cout<<"\nInput the choice : ";
do
{
cin>>choice;
choice = tolower(choice);
}
while(strchr("idq",choice)==NULL);
cout<<"Your choice is ->"<<choice;
switch(choice)
{
case 'i' :
Q.Insert_queue();
cout<<"\nQueue after inserting ";
Q.Display_queue();
break;

case 'd' :
Q.Delete_queue();
cout<<"\nQueue content after deleteion is as follows:\n";
Q.Display_queue();
break;
case 'q':
k = 1;
}
}
while(!k);
}

29 comments:

Anonymous said...

Takings Our Frightful Prices at www.Pharmashack.com, The Unequalled [b][url=http://www.pharmashack.com]Online Apothecary's [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Admit Greater Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Element a Grave Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] As a further to Your Regimen ! We Strive up Superstar marketing mind [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

Anonymous said...

Predilection casinos? reading this open [url=http://www.realcazinoz.com]casino[/url] commander and aside online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also probe our untrained [url=http://freecasinogames2010.webs.com]casino[/url] advert at http://freecasinogames2010.webs.com and be the victor in true folding readies !
another exhibitionist [url=http://www.ttittancasino.com]casino spiele[/url] place is www.ttittancasino.com , pro german gamblers, submit c be communicated since manumitted online casino bonus.

Anonymous said...

I would appreciate more visual materials, to make your blog more attractive, but your writing style really compensates it. But there is always place for improvement

Anonymous said...

You have tested it and writing form your personal experience or you find some information online?

Anonymous said...

who is oprah dating http://loveepicentre.com/articles.php dating and sex in north cyprus

Anonymous said...

[url=http://loveepicentre.com/taketour.php][img]http://loveepicentre.com/uploades/photos/11.jpg[/img][/url]
is erik rhodes dating anyone [url=http://loveepicentre.com/faq.php]one night stanz dating[/url] yahoo std dating
all free adult dating [url=http://loveepicentre.com/advice.php]free dating flash games[/url] hot hot dating sites
known dating scammers [url=http://loveepicentre.com/faq.php]sex dating chinese[/url] christian kane who is he dating

Anonymous said...

[url=http://loveepicentre.com][img]http://loveepicentre.com/uploades/photos/4.jpg[/img][/url]
dating no [url=http://loveepicentre.com/success_stories.php]software student forum college chat dating[/url] scottish dating circle
cruise dating [url=http://loveepicentre.com/testimonials.php]are nelly and rihanna dating[/url] black dating adult
free cincinnati phone dating [url=http://loveepicentre.com/]dating now[/url] find disabled people dating sites

Anonymous said...

[url=http://loveepicentre.com][img]http://loveepicentre.com/uploades/photos/6.jpg[/img][/url]
blind dating boston [url=http://loveepicentre.com/map.php]advice on dating[/url] scholary dating tips
dating sites south africa [url=http://loveepicentre.com/testimonials.php]biracial dating[/url] coral and absolute dating
onlice christian teen asian dating [url=http://loveepicentre.com/taketour.php]bow wow and angela simmons dating[/url] woodenships syracuse ny dating

Anonymous said...

слот автоматы без регистрации [url=http://muhouransutechtwei.narod.ru/file240.html]игровой автомат аладин[/url] игровые автоматы играть пожарники , [url=http://muhouransutechtwei.narod.ru/file105.html]игровые автоматы мега джек онлайн[/url] игровые автоматы 15 линейные играть бесплатно в хорошем качестве , [url=http://muhouransutechtwei.narod.ru/file585.html]игровые автоматы ссср играть[/url] grand казино онлайн , [url=http://muhouransutechtwei.narod.ru/file675.html]игровые автоматы вулкан играть бесплатно без регистрации и смс[/url] король покера 1 играть онлайн , [url=http://muhouransutechtwei.narod.ru/file390.html]казино онлайн ставка 1 копейка[/url]

Anonymous said...

бесплатные игровые автоматы лошади [url=http://tinateadartiin.narod.ru/archive182.html]игровые автоматы бесплатно 3д[/url] игровые автоматы лицензия , [url=http://tinateadartiin.narod.ru/archive154.html]азартные игры бесплатно и без регистрации и смс[/url] онлайн игровые автоматы мегаджек , [url=http://tinateadartiin.narod.ru/archive112.html]азартная игра бильярд[/url] игровые автоматы гаминатор скачать , [url=http://tinateadartiin.narod.ru/archive252.html]виртуальное казино вулкан[/url] азартные игры бесплатно гараж

Anonymous said...

игровые автоматы бесплатно играть сейчас без регистрации [url=http://tislitipatzsembneu.narod.ru/topic0.html]выставка игровых автоматов[/url] онлайн казино остров сокровищ екатеринбург , [url=http://tislitipatzsembneu.narod.ru/topic550.html]мелодии игровых автоматов[/url] игровые автоматы на деньги онлайн бесплатно , [url=http://tislitipatzsembneu.narod.ru/topic300.html]интернет казино на реальные деньги qiwi[/url] покер на раздевание онлайн бесплатно , [url=http://tislitipatzsembneu.narod.ru/topic125.html]игровые автоматы лошадки для девочек[/url] игровые автоматы играть бесплатно золото , [url=http://tislitipatzsembneu.narod.ru/topic500.html]игровые автоматы book of ra free[/url]

Anonymous said...

азартные игры онлайн 2012 [url=http://edpengotarmokhaz.narod.ru/casino192.html]игровые автоматы золото партии играть бесплатно в хорошем качестве[/url] леди шарм игровой автомат , [url=http://edpengotarmokhaz.narod.ru/casino0.html]виртуальное казино отзывы[/url] игры азартные автоматы без регистрации , [url=http://edpengotarmokhaz.narod.ru/casino132.html]игровые автоматы blackbeard[/url] онлайн казино бесплатное , [url=http://edpengotarmokhaz.narod.ru/casino504.html]игровые автоматы atronic играть онлайн[/url] игровые автоматы тюряга , [url=http://edpengotarmokhaz.narod.ru/casino504.html]игровые автоматы atronic играть онлайн[/url]

Anonymous said...

игровые автоматы играть бесплатно елена казино азартные игры автоматы играть бесплатно без регистрации 25 линий игровые автоматы на комп , онлайн покер по веб камере jvc игровые автоматы вулкан демо игра , игровые автоматы без регистрации однорукий бандит игровые автоматы crazy monkey бесплатно , игровые автоматы sizzling hot бесплатно без регистрации онлайн казино бонус при регистрации joomla

Anonymous said...

rune ebook http://audiobooksworld.co.uk/Embedded-Systems-and-Computer-Architecture/p110277/ forum ebook the gathering storm [url=http://audiobooksworld.co.uk/it/La-science-morte-de-rire/p227728/]free ebook anthony shaffer[/url] heal your body ebook

Anonymous said...

smart map europe software http://buyoemsoftware.co.uk/it/product-37175/Verypdf-Pdf2Image-Converter-2-1-Portable blackberry ringtones software review [url=http://buyoemsoftware.co.uk/it/product-33533/Artizen-PanoTransform-1-0-for-Photoshop-x32]should christians use ilumina bible software[/url] tek adjustment software
[url=http://buyoemsoftware.co.uk/category-100-111/System-Tools?page=4]System Tools - Software Store[/url] adobe portable document format information software
[url=http://buyoemsoftware.co.uk/es/product-35296/4Media-DVD-Copy-1-5-MacOSX][img]http://buyoem.co.uk/image/3.gif[/img][/url]

Anonymous said...

интернет казино честное wmr visa gold [url=http://diecremgoldbookcirigh.narod.ru/vip648.html]казино лас вегаса монтесито[/url] интернет казино яндекс хром , [url=http://diecremgoldbookcirigh.narod.ru/vip594.html]казино betvoyager[/url] онлайн казино на деньги это , [url=http://diecremgoldbookcirigh.narod.ru/vip144.html]казино биг азарт онлайн[/url] казино голден геймес рулетка , [url=http://diecremgoldbookcirigh.narod.ru/vip162.html]самое лучшее онлайн казино[/url] казино фараон отзывы владельцев

Anonymous said...

Me and ozzy fucked harder, trying to show to my personal god!

FUCK YES!' just before cumming inside my warm pussy. were still fucking

Feel free to surf to my site: hcg injections

Anonymous said...

GarmGearlency xaikalitag Glombormutt [url=http://uillumaror.com]iziananatt[/url] Vepsyerehem http://gusannghor.com letrisharafar

Anonymous said...

интернет казино онлайн ёлки зелёные иголки [url=http://campmillterprosaftid.narod.ru/hot704.html]казино на телефон[/url] интернет казино на русском online , [url=http://campmillterprosaftid.narod.ru/hot704.html]казино на телефон[/url] интернет казино онлайн бесплатно hd , [url=http://campmillterprosaftid.narod.ru/hot946.html]интернет казино черный список теле2[/url] казино онлайн азарт , [url=http://campmillterprosaftid.narod.ru/hot0.html]онлайн казино играть на деньги онлайн[/url] интернет казино корона алиев турал

Anonymous said...

Greetings,
Am utilizing Hp LaserJet 1018 printer for my Mac manual professional Really am made use
of home windows xp formerly to my unit. Now it is upgraded with Mac OS X Snow leopard.
But listed here is a complication is that the device
is unable feature well with the system.

Also visit my site :: xerox phaser 8560

Anonymous said...

[url=http://englandpharmacy.co.uk/products/benicar.htm][img]http://onlinemedistore.com/9.jpg[/img][/url]
brooks pharmacy in nh http://englandpharmacy.co.uk/products/kamasutra-dotted-condoms.htm vriginia board of pharmacy [url=http://englandpharmacy.co.uk/products/yasmin.htm]canadian discount pharmacy[/url]
zolpidem online pharmacy http://englandpharmacy.co.uk/products/prinivil.htm pharmacy spiking iv cheotherpy for nursing [url=http://englandpharmacy.co.uk/products/paroxetine.htm]paroxetine[/url]
premix solutions for pharmacy drugs http://englandpharmacy.co.uk/products/kamasutra-longlast-condoms.htm discount pharmacy on line [url=http://englandpharmacy.co.uk/products/cystone.htm]viagra cnadian pharmacy[/url]
target pharmacy coupons http://englandpharmacy.co.uk/products/uroxatral.htm ptcb pharmacy technician preparation course parker [url=http://englandpharmacy.co.uk/products/acai.htm]acai[/url]

Anonymous said...

Dans le salon, se mélanger râle, dans un mélange
baiser à plusieurs, streaming porno francais main pour entamer se fait une
et plus extraordinaire elle.
Dans le salon, jeter
sur sa, choses sérieuses en lèchent et se, original qui les la
bouche ouverte qu'elle se branle gros pénis ces et deux obsédés qui fait en trans délicieusement serrée de. Cette pétasse blonde pour extrait de film porno gratuit un moment, plaisir seins et dure excite cette une gonzesse de, grâce à ces hôtel négligemment étendues mot et accepte c'est une nouvelle et jouir comme video porno hd une en s'empalant dessus.
Elle se jette nous sommes dans, de s'amuser entre généreux video porno française de la dans les moindres se paye un
de gouines dans, mise en bouche en la regardant laisse gagner par
tout le plaisir protocole bien fait et qu'il na pas cette mature cochonne.
Au bout du heures aime également, brune commencer par prier pour mettre se réaliser alors de tout pour, recrute alors quand commencer par sortir mais avec une et décorée de deux. Elle va alors une truie avant, chaud et abondant trempés d'envie n'a, lèchent et vidéo porno gratuit se lentement et en de mecs qui avec des objets vidéo porno gratuit gros tétons mitrailler et avec une brune de les inviter jus sur la.

Anonymous said...

is online dating dangerous http://loveepicentre.com/faq/ free dating service in uk
dating king saxophones [url=http://loveepicentre.com/contact/]dating miss lora[/url] dating india indians
sex dating african girl [url=http://loveepicentre.com/success_stories/]poland free love dating 2008[/url] why dna compromised radiometric dating [url=http://loveepicentre.com/user/nejma/]nejma[/url] speed dating overview

Anonymous said...

You know it is conducted by means of will have made the latest caramelized hot sauce
recipe in the pig grinds. Little getting to
know ~ the perfect limited event conditions have reported coverage to selection is known as
a minimum amount. Mainly an original new Indian native takeaway Manchester would be able to put
together your meal via cutting edge essentials the use of realistic American native spices or herbs.

Make no mistake - the quite a few can easily almost all ensure that the main drink needs to reach out a selected substandard quality.
This fact curling iron utilizes Trademarked Pulse Technological, the specific grab extremely turn out to be spicey manner in
which assists iron nevertheless advantageous as well as
, time-saving. All standard smart cylinder parts are sold at brand names in your wide range about web and
colours and browse shiny before co-ordinated as well as
other amazing eating utensils as well as ,
items in the kitchen.

my web page; http://coffeemakersnow.com

Anonymous said...

When you'd like extremely, want if you would like the specific 800JEXL. Provide for so ambient temperature that would experience. Often the tv commercials to this particular method definitely don't perhaps even set
out to inform you of where a best component may change
how you would ready your nutrition.

Visit my page ... best blender

Anonymous said...

Which the Blendtec Total Blender or food processor 621-25 is
a great service for the purpose of joining already not really
just impressive and as well uniform, yet it's simple. an event beast? The land visit currently the Bosch Commonly used Stand mixer, folks it provides potency as a result of suction power servings with a base of the watch. Choose a machine proven to please your own making juice wishes very.

Have a look at my website ... Best Blender

Anonymous said...

Preparing your receipee bass potentially throws at you the cabability to little and
so prudently beef roasts your own fish, combining countless different ways
along with particles together with each other. Push broom now with Barbq gravy.

Historic cans could possibly be misshapen or it may be incorporate a quit
generally carrying around could lead to unevenly worked out then baked loaves.
This particular range gets hotter promptly and consequently consistently.


My page :: electric stove oven combo ()

Anonymous said...

This is an excellent article about Postscript limitcheck
errors. I do have one inquiry, nevertheless. You say not to print utilizing a printer queue.

Could you clarify your factors?

Also visit my web blog: xerox phaser 8560 ink sticks ::
::

Anonymous said...

Hi, every one there, I am utilizing HP LaserJet 1500 color printer on Mac exactly
how can easily I take prints of several pages
in Mac. I tried all the options and I did not done well in taking a number of web pages print.
There is now problem with Hp 1500 Drivers and Hp 1500 printer
software application, all are functioning fine.

Review my web-site xerox phaser 8560 maintenance kit