So I need some help, I am working with an STL list, std::list linkedList = std::list{50}; how can i iterate througth the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

So I need some help, I am working with an STL list, std::list linkedList = std::list{50}; how can i iterate througth the

Post by answerhappygod »

So I need some help, I am working with an STL list, std::listlinkedList = std::list{50}; how can i iterate througth the list andlook for empty or nodes that are false only in between, For exampleafter i have filled my list randomly, i want to check for nodesthat are not in use, xxx0xxx00xx000xxxxx = 3 (x=in use 0=empty) and000xx00xx00x00000end of list. = 2. I am trying to count the groupof nodes that are in between that are not in used. I hope this makesense.
I am using a struct such that: struct
Node { bool inUse = false; int pID = 0; };
and my list:
std::list linkedList = std::list{50};
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply