Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the performance of the forward_list container in Clover 11?

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "how is the performance of the forward_list container in Craft 11". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how is the performance of the forward_list container in Craft 11".

To understand the performance of the forward_list container, we write the following code to test the efficiency of the insert operation:

Struct Node {

Node (int v): value (v), next (nullptr) {}

Node* next

Int value

}

DWORD begin = GetTickCount ()

/ / std::forward_list list

/ *

Std::list list

For (int I = 0; I

< 10000000; ++i) list.push_front(i); */ Node* head = nullptr; for(int i = 0; i < 10000000; ++i){ Node* new_node = new Node(i); new_node->

Next = head;,

Head = new_node

}

DWORD end = GetTickCount ()

Std::cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report