Click here to Skip to main content
15,914,165 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My queue contains "apple, orange, grape, papaya etc.." i want to know the index value of "grape". How can i get it..?
Posted
Comments
Sergey Alexandrovich Kryukov 28-Nov-11 2:40am    
Why? Identify what exactly features of a container do you need.
--SA

1 solution

Use System.Collections.Generic.List<T> then, not queue. Queue is designed and optimized for sequential access, first-in-first-out.

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Nov-11 11:00am    
Explaining if somebody did not get it: Queue does not have this method, but List.IndexOf does it.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900