Results 1 to 6 of 6

Thread: The list container of the C++

  1. #1
    Join Date
    Jan 2010
    Posts
    26

    The list container of the C++

    I can have the basic idea of the classes or containers. I know what can do and what can be their purpose in the C++ language. But I can not known anything about the some of the containers of the C++ language. So, I want to know about the list container of the C++ language and how they can be used in the C++ language. Thus if anyone knows about the list containers then Reply me!!!

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    The list container of the C++

    The List containers can be used as doubly-linked lists. The Doubly linked lists could store every elements they contain in unrelated and different locations that can be of the storage. The ordering can kept by an association to every an element of the link to an element that can be starting it and a link that can be to an element that can be following it.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: The list container of the C++

    The list containers can provides you the following benefits and advantages as follows :
    1. In constant time, moving the block of an elements and elements in the container efficiently or though between various containers.
    2. In linear time, Iterating over the elements in reverse order or in the forward order.
    3. In constant time, the removal and the insertion of an elements anywhere in the class or container.

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: The list container of the C++

    The storage can be handled or managed automatically by the class or container by allowing the lists to be contracted and an expanded as you needed. In their presentation or use in the C++ STL that can be Standard Template Library, The lists can take two parameters of the templates and this can be the syntax of the list containers as follows :
    Code:
    template < class S, class Aloctr = aloctr<S> > class list;

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: The list container of the C++

    The following can be the parameters of the list containers of the C++ language as follows :
    1. Aloctr: This parameter of the can contains the type of the aloctr object that can be used to explain the storage allocation model. The aloctr class template for the type S can be used which can explains the value-independent and the an easiest allocation of memory model.
    2. S: This parameter can contains the type of an elements that can be used by the container.

  6. #6
    Join Date
    May 2008
    Posts
    2,297

    Re: The list container of the C++

    PROGRAM :
    Code:
        #include <iostream>
        #include <list>
        using namespace std;
        main()
        {
           list<int> S;
           S.pushback(0);              
           S.pushfront(0);             
           S.insert(++L.begin(),2);  
           S.pushback(5);
           S.pushback(6);
           list<int>::iterator k;
           for(k=S.begin(); k != S.end(); ++k) cout << *k << " ";
           cout << endl;
           return 0;
        }
    Output :
    Code:
    0 2 0 5 6

Similar Threads

  1. .mov file container
    By Rufta in forum Windows Software
    Replies: 3
    Last Post: 25-12-2010, 03:27 PM
  2. Need a .MOV File container
    By VAIJAYI in forum Windows Software
    Replies: 3
    Last Post: 25-12-2010, 04:08 AM
  3. What is Servlet container?
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 08:13 AM
  4. How to create DB2 9.5 container
    By Pollock in forum Windows Software
    Replies: 3
    Last Post: 12-08-2009, 11:57 AM
  5. STL container question
    By JACKOPA in forum Software Development
    Replies: 4
    Last Post: 25-10-2008, 04:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,713,403.42694 seconds with 17 queries