Well the Queue is a first in, first out collection, |
| Peter Bromberg replied to Jobi K John at 07-May-08 03:48 |
and the Stack is a last in, first out collection. So you could certainly use either queue or stack but neither is exactly designed for what you want. Probably you'd be better just creating your own class that holds a List<string> (a generic List of type string) and handle the counting with your Add method. It would determine if the length is 10 and if so it would remove the item from the 1st position and add the new name at the end.
The Generic List class also has a number of handy intrinsic methods for finding, etc. that are not present in either Stack or Queue. |
| Biography |
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking ,financial and telephony for 20 years. Pete focuses exclusively on the .NET Platform, and his samples at GotDotNet.com have been downloaded over 56,000 times. Peter enjoys producing 3D raytraced digital photo collage with Maya, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites. Please post questions at forums, not via email! |  |  |
|