What do you notice about how the list has been sorted?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 16PE
icon
Related questions
Question
Please answer the ques
5. Create a list letters, that contains all lowercase letters from a to e.
a) Print the list.
b) Print the second to last element in the list.
c) Reverse the list.
d)
Print the list.
e)
Print the third to last element in the list.
f) Replace the lowercase letter 'b' with uppercase letter 'B'.
g) Replace the lowercase letter 'd' with uppercase letter 'D'.
h) Print the list.
i) Alphabetically sort the list.
j) Print the list.
What do you notice about how the list has been sorted?
Output Example
['a', 'b', 'c', 'd', 'e']
d
['e', 'd', 'c', 'b', 'a']
с
['e', 'D', 'c', 'B', 'a']
[ 'B', 'D', 'a', 'c', 'e', ]
Transcribed Image Text:5. Create a list letters, that contains all lowercase letters from a to e. a) Print the list. b) Print the second to last element in the list. c) Reverse the list. d) Print the list. e) Print the third to last element in the list. f) Replace the lowercase letter 'b' with uppercase letter 'B'. g) Replace the lowercase letter 'd' with uppercase letter 'D'. h) Print the list. i) Alphabetically sort the list. j) Print the list. What do you notice about how the list has been sorted? Output Example ['a', 'b', 'c', 'd', 'e'] d ['e', 'd', 'c', 'b', 'a'] с ['e', 'D', 'c', 'B', 'a'] [ 'B', 'D', 'a', 'c', 'e', ]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning