🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 14 (from laksa192)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
3 months ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH3.3 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://cplusplus.com/forum/general/279537/
Last Crawled2025-12-31 16:00:57 (3 months ago)
First Indexed2021-08-19 00:11:37 (4 years ago)
HTTP Status Code200
Meta TitleRemove 2 elements from a queue - C++ Forum
Meta Descriptionnull
Meta Canonicalnull
Boilerpipe Text
Unfortunately I can’t post all the code because it’s from a big exam theme from 4 years ago and the first step was about to open a text file and create a queue of items, too big to post it. I already made these 2 points and I need help for this third. I have this queue of items. Every item into the queue have a name and an height (United States,127.2) (United States,120.1) (United States,100.2) (United States,98.8 ) (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) My output should be : That’s because I dequeue 2 elements from the queue i and j. If i <92 I have to remove it from the queue and if j > i I also have to remove j from the queue. This because i and j rapresents the height of the items. I have to analyse 2 items from the queue every time , If the height of the second item is bigger than the height of the first item , I have to cancel j. (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) The operations I can do it are enqueue ( insert a element from the top ) , dequeue ( remove an element from the bottom ) and I have length that’s the length of the queue. I hope , this time , to be more specific. Sorry for my terrible English, I’m Italian
Markdown
[cplusplus .com](https://cplusplus.com/) - [TUTORIALS](https://cplusplus.com/doc/) - [REFERENCE](https://cplusplus.com/reference/) - [ARTICLES](https://cplusplus.com/articles/) - [FORUM](https://cplusplus.com/forum/) ### **[C++](https://cplusplus.com/)** - [Tutorials](https://cplusplus.com/doc/) - [Reference](https://cplusplus.com/reference/) - [Articles](https://cplusplus.com/articles/) - [Forum](https://cplusplus.com/forum/) ### **[Forum](https://cplusplus.com/forum/)** - [**Beginners**](https://cplusplus.com/forum/beginner/) - [**Windows Programming**](https://cplusplus.com/forum/windows/) - [**UNIX/Linux Programming**](https://cplusplus.com/forum/unices/) - [**General C++ Programming**](https://cplusplus.com/forum/general/) - [**Lounge**](https://cplusplus.com/forum/lounge/) - [**Jobs**](https://cplusplus.com/forum/jobs/) - [Forum](https://cplusplus.com/forum/) - [General C++ Programming](https://cplusplus.com/forum/general/) - Remove 2 elements from a queue ### Remove 2 elements from a queue [![](https://cplusplus.com/img/link.png)](https://cplusplus.com/forum/general/279537/#msg1207815 "Link to this post") Aug 18, 2021 at 5:01am UTC [**ellosma** (3)](https://cplusplus.com/user/ellosma/) I have a Lqueue queue from which I have to remove all elements (of type Item) with a height\> 92 and also I have to remove all elements that have a greater height than the previous element (it does not apply to the first element). for example if I have: (United States,127.2) (United States,120.1) (United States,100.2) (United States,98.8 ) (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) My output should be : (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) For the first part I tried made for (int i = 0; i \< Q1.length(); i++) { if (temp.getcode() \< '92') { Q1.dequeue(); } } But in this case I made the opposite I should. The program print some ( and not all ) of the elements that it should cancel. The second part I have no idea how to do it because i can only use enqueue (inserting an element, but from the head), dequeue (removing an element, from the queue), length (indicating the length of the queue), frontValue (indicating the first element of the queue), clear to clear all elements present in the queue. Last edited on Aug 18, 2021 at 5:12am UTC [![](https://cplusplus.com/img/link.png)](https://cplusplus.com/forum/general/279537/#msg1207832 "Link to this post") Aug 18, 2021 at 8:41am UTC [**lastchance** (6980)](https://cplusplus.com/user/lastchance/) You haven't shown remotely enough code and your Lqueue (linked-list queue) seems a bit of a weird data structure; we have no details of it or how to test it. In the minimal loop you have shown: - what is the variable temp ? - why do you suppose dequeue() (which presumably removes something from the front of the queue) should act on the element you are trying to get rid of? - for something based on a linked list it is unusual to use an index-based loop counter ... especially one terminating at a value that keeps changing, as you would not then cover all elements of the data structure. It may be simpler to construct a new Lqueue from the elements that you wish to keep. However, you haven't given enough code to provide much of an answer to your question. BTW. Get used to using code tags. Last edited on Aug 18, 2021 at 8:46am UTC [![](https://cplusplus.com/img/link.png)](https://cplusplus.com/forum/general/279537/#msg1207834 "Link to this post") Aug 18, 2021 at 9:12am UTC [**ellosma** (3)](https://cplusplus.com/user/ellosma/) Unfortunately I can’t post all the code because it’s from a big exam theme from 4 years ago and the first step was about to open a text file and create a queue of items, too big to post it. I already made these 2 points and I need help for this third. I have this queue of items. Every item into the queue have a name and an height (United States,127.2) (United States,120.1) (United States,100.2) (United States,98.8 ) (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) My output should be : That’s because I dequeue 2 elements from the queue i and j. If i \<92 I have to remove it from the queue and if j \> i I also have to remove j from the queue. This because i and j rapresents the height of the items. I have to analyse 2 items from the queue every time , If the height of the second item is bigger than the height of the first item , I have to cancel j. (United States,91.1) (United States,91.5) (United States,91.6) (United States,126.7) (United States,55.5) (United States,50.6) (United States,48.9) (United States,41.2) (United States,39.1) (United States,49.4) (United States,46.3) (United States,43.8 ) The operations I can do it are enqueue ( insert a element from the top ) , dequeue ( remove an element from the bottom ) and I have length that’s the length of the queue. I hope , this time , to be more specific. Sorry for my terrible English, I’m Italian Last edited on Aug 18, 2021 at 9:14am UTC [![](https://cplusplus.com/img/link.png)](https://cplusplus.com/forum/general/279537/#msg1207842 "Link to this post") Aug 18, 2021 at 10:41am UTC [**lastchance** (6980)](https://cplusplus.com/user/lastchance/) | | |---| | This because i and j rapresents the height of the items. | Not if i is a loop variable it isn't. The simplest way using only enqueue, dequeue, frontvalue and length is to traverse your original loop from the front (using frontvalue and dequeue) and construct a new queue with the desired elements (using enqueue). [![](https://cplusplus.com/img/link.png)](https://cplusplus.com/forum/general/279537/#msg1207845 "Link to this post") Aug 18, 2021 at 11:42am UTC [**ellosma** (3)](https://cplusplus.com/user/ellosma/) This is what I wrote , the output is correct only partially. This print all the correct items but also some items that are not correct. I have to use only one queue. I have to insert some loop at the end of if but with break I obtained the same things Last edited on Aug 20, 2021 at 7:49am UTC Topic archived. No new replies allowed. [Home page](https://cplusplus.com/) \| [Privacy policy](https://cplusplus.com/privacy.do) © cplusplus.com, 2000-2025 - All rights reserved - *v3.3.3* [Spotted an error? contact us](https://cplusplus.com/contact.do?referrer=cplusplus.com%2Fforum%2Fgeneral%2F279537%2F)
Readable Markdownnull
Shard14 (laksa)
Root Hash7671136614093794214
Unparsed URLcom,cplusplus!/forum/general/279537/ s443