If the list is array based class, L1 is an object of the class list, the best code used to empty the L1 is a. for(int i=0;i

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 17PE
icon
Related questions
Question

data  structure 

please solve it fast in 10 minutes

If the list is array based class, L1 is an object of the class list, the best code used to empty the L1 is
O a. for(int i=0;i<L1.size(;i++) L1.remove(0);
O b. while(!L1.empty0) L1.remove(L1.size(-1);
O c. for(int i=0;i<L1.size(;i++) L1.remove(i);
O d. while(!L1.empty(0) L1.remove(0);
Transcribed Image Text:If the list is array based class, L1 is an object of the class list, the best code used to empty the L1 is O a. for(int i=0;i<L1.size(;i++) L1.remove(0); O b. while(!L1.empty0) L1.remove(L1.size(-1); O c. for(int i=0;i<L1.size(;i++) L1.remove(i); O d. while(!L1.empty(0) L1.remove(0);
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Expressions
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