Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 131,573 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,090 people online right now. Registration is fast and FREE... Join Now!




data structure help in c++

 
Reply to this topicStart new topic

data structure help in c++, FIFO, LIFO, Stack, Queue

semooo
post 29 Nov, 2005 - 12:42 PM
Post #1


New D.I.C Head

*
Joined: 29 Nov, 2005
Posts: 1


My Contributions


hi Im waseem
I need an immediate help as soon as possible,
I have three simple question with coding problems in data structure in c++
thess are :
1)suppose that you are finanicier and purchase 100 shares of stock in company X , in each of january , april , and september and sell 100 shares in each of june and november
the price per share in these months were
jan apr jun sep nov
$10 $30 $20 $50 $30

determine the total amount in your capital gain or loss , using
a)FIFO accounting
b)LIFO accounting
that is assuming that you keep your stock certificate in
a)a queue or
B) a stack.

the 100 shares you still own at the end of the year
dont enter the calculation.


question number 2:

write the methode to implement queues by the simple but slow technique of keeping the front of queue always in the first position of a leaner array.


question number 3:
write the method to implement queues where the implementation does not keep account of the entries in the queue but instead use the special conditions

rear=-1
and
front=0
to indicate an empty queue
User is offlineProfile CardPM

Go to the top of the page


Nova Dragoon
post 29 Nov, 2005 - 12:45 PM
Post #2


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,124



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


The forum rules, in general for next time.

And I've moved it to C++ forum


Can you show us some code you've written so far?
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/20/08 03:19AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month