-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Tango
Message 1 in Discussion

Hi,   Can any one help me out by sharing some sites which are related to STL 
implementation in C#?   Please note not the c++ code i need any one container 
class code in C# which list.   Some basic information for people who are new to 
Generics & Standard template library.    Standard Template Library<o:p></o:p> 
STL: An Overview<o:p></o:p> 

Any programmer developing a moderately complicated system soon realizes that 
efficient coding requires the use of fundamental data structures like lists, 
queues and stacks as well as algorithms to process the data stored in these 
data structures. <o:p></o:p>     
<ADLINKS></ADLINKS><o:p> </o:p> 
Most Java programmers would be familiar with various implementations of these 
data structures in the util package. Until 1994, C++ did not have, as a part of 
its standard library, support for such data structures. This implied that any 
programmer developing software that required the use of such structures either 
had to build such a library or purchase one being offered commercially. 
<o:p></o:p> 
The former option had risks of increased development time and costs associated 
with it. Reducing such risks meant customizing the library to the application 
for which it was being developed, resulting in its incompatibility with other 
application that will be developed in the future.<o:p></o:p> 
The latter option although reduced the risks associated with the first option 
but introduced following further risks,<o:p></o:p>        Issues related to 
potential incompatibility with platforms, development environments and other 
libraries to which the software has to be linked, <o:p></o:p>    Future costs 
of upgrades. All programmers are well aware of incremental costs of software 
upgrades that offer more and/or improved features, <o:p></o:p>        Potential 
performance and extensibility issues related to the characteristics of 
implementation. For example, the use of virtual functions in internal objects 
can not only reduce the performance of the library but also make it difficult 
to use in a shared memory system. Algorithms in such libraries are usually 
implemented as class members thereby restricting change. <o:p></o:p> 
To overcome these issues, the ANSI (American National Standards Institute) 
decided to select STL as a standard set of collection classes and algorithms. 
STL is based on the successful research and development at Hewlett Packard 
Laboratories in the area of generic programming.<o:p></o:p> 
Typical features of STL are as follows,<o:p></o:p>      Efficiency. STL does 
not use inheritance or virtual functions. <o:p></o:p>      Type safety. The 
extensive use of C++ templates makes STL type safe. <o:p></o:p>        
Consistency. STL container classes use iterators that are generalized pointers 
to the data contained within the containers. Iterators allow access of data 
within the containers in a manner similar to C arrays. <o:p></o:p>   
Extensibility. <o:p></o:p>      STL algorithms are stand-alone functions that 
do not access STL containers directly. Rather they operate over the data via 
the iterators. <o:p></o:p>   STL allows the use of function objects. These are 
functions that can be encapsulated and associated with data. These can be 
created, stored and destroyed like objects. <o:p></o:p>     STL memory 
management does not explicitly use new and delete operators. STL containers use 
special allocator objects to allocate and deallocate storage. If an application 
requires different memory allocation and deallocation policies, these can be 
implemented using specialised allocator objects. These allocators can then 
replace the standard allocators in the containers to provide custom memory 
management. This article will, however, only consider the use of standard 
allocators. <o:p></o:p> STL Containers<o:p></o:p> 

STL containers are classes whose objects can be used to build collections of 
data of same type. For example, objects of vector and list classes are used to 
build a one dimensional collection of data (although two dimensional 
collections are possible as lists of lists), maps are used to build lookup 
tables and sets provide a unique collection of data (i.e., each data element 
exists only once). <o:p></o:p> 
STL containers can be divided into the following three categories,<o:p></o:p>   
Sequential containers. These containers arrange the data they contain in a 
linear manner. <o:p></o:p>   Associative containers. These containers maintain 
data in structures suitable for fast associative look-up. <o:p></o:p>         
Adapters. These provide different but more appropriate interfaces to containers 
belonging to the above-mentioned categories. <o:p></o:p> 
Specific containers belonging to each category are listed in the following 
table.<o:p></o:p>         
Category<o:p></o:p>  
Containers<o:p></o:p>  
Characteristics<o:p></o:p>   
Sequential<o:p></o:p>  
vector<o:p></o:p>  
Provides a linear and contiguous storage (similar to an array) that allows fast 
inserts at the end only.<o:p></o:p>   
list<o:p></o:p>  
It is an implementation of a doubly linked list that allows fast inserts 
anywhere.<o:p></o:p>   
deque<o:p></o:p>  
Provides a linear but non-contiguous storage that allows fast inserts at 
extremities.<o:p></o:p>   
Associative<o:p></o:p>  
multiset<o:p></o:p>  
It is an implementation of set where duplicates are allowed and provides fast 
associative lookup.<o:p></o:p>   
set<o:p></o:p>  
It is an implementation of set where no duplicates are allowed and provides 
fast associative lookup.<o:p></o:p>   
multimap<o:p></o:p>  
It is an implementation of a key to value mapping structure where a single key 
can be mapped to many values (1 to many mappings).<o:p></o:p>   
map<o:p></o:p>  
It is an implementation of a key to value mapping structure where a single key 
can only be mapped to one value (1 to 1 mapping).<o:p></o:p>   
Adapter<o:p></o:p>  
stack<o:p></o:p>  
It is an implementation of a first in last out data structure.<o:p></o:p>   
queue<o:p></o:p>  
It is an implementation of a first in first out data structure.<o:p></o:p>   
priority_queue<o:p></o:p>  
A queue that maintains items in a sorted order.<o:p></o:p> 
The coming sections will discuss using vectors, lists, sets, maps, stacks and 
queues in programs. The remaining containers have APIs similar to other 
containers in their categories.<o:p></o:p> 
1 <o:p></o:p> 
<o:p> </o:p>    

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to