Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
Question
Book Icon
Chapter 18, Problem 25RQE
Program Plan Intro

Standard Template Library (STL) list container:

The STL includes the collection of data types and algorithms which can be used by the programmer in their programs.

The STL “list” container is a template version of “doubly” linked list. The elements of the container can iterate either forward or backward. It can grow at either front or back of the list.

The header file named “#include<list>” is used to implement the list container in a program.

Syntax:

Syntax to reverse the order of “STL list” container is as follows:

variable_name.reverse();

  • “variable_name” is the name of the list which is defined by user.
  • “reverse()” is a method to reverse the order of elements in the container.

Blurred answer
Students have asked these similar questions
Write a For Each loop that displays every element of an array named strSongNames in a ListBox named lstDisplay. The loop variable is named strPlay.
reverse_number_in_list(number_list:list)-> list 
This function will be given a list of numbers your job is to reverse all the numbers in the list and return a list with the reversed numbers. If a number ends with 0 you need to remove all the trailing zeros before reversing the number. An example of reversing numbers with trailing zeros:  10 -> 1,  590 -> 95. None of the numbers in the number_list will be less than 1.  Example: number_list = [13, 45, 690, 57] output = [31, 54, 96, 75]
What are the data items in a list called? elements values items data
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT