pls help me it is so urgent

ı need short examples with queues,

it is so important me pls send there small exercises that done with queue

thanks so much everyone

Printable View

- 12-01-2007rebelfirstqueues
pls help me it is so urgent

ı need short examples with queues,

it is so important me pls send there small exercises that done with queue

thanks so much everyone - 12-01-2007MacGyver
Google?

Edit: You could have at least checked out this site, btw....

http://www.cprogramming.com/tutorial...ory/queue.html

That contains a link to a code example. - 12-01-2007swgh
Google: "Queue exercises in C++"

- 12-01-2007rebelfirst
pls sned ı search all interenet but cant find if u have queue examples send

- 12-01-2007MacGyver
Try clicking the link?

- 12-01-2007rebelfirst
just one example and no more pls interest this topic

- 12-01-2007matspCode:
`int main()`

{

Queue.insert(1);

Queue.insert(2);

cout << Queue.get();

cout << Queue.get();

return 0;

}

--

Mats - 12-01-2007matsp
Does anyone think this will do?

Code:`template <typename T>`

class q {

private:

class p {

public:

p() : n(0) {};

T d;

p *n;

};

p *h, *t;

public:

q<T>(): h(0), t(0) {};

void insert(T x) {

t = (t)?(t->n=new p):(h = t = new p);

t->d = x;

};

bool get(T &x) {

p* p = h; if (!p) return false;

x = p->d; h = (p == t)? t = p->n : p->n;

delete p;

return true;

};

};

On the obfuscation: I'm sure I could make get use another terniary operator for the return value, but I guess it's close enough as it is...

-- - 12-02-2007rebelfirst
pls help me more complex examples nuone doesnt know about queue?

- 12-02-2007Salem
I've just been shopping, and there are plenty of queues at the checkouts.

There's even an "8 items or less" express checkout.

Write a simulation modelling the movement of people through a store checkout, where

- number of items

- number of distracting / yelling kids

- number of money off coupons

- method of payment (cash, cheque, card)

All affect how fast an individual person makes it through the checkout.