00 in front
[STL source code analysis] summary note (8): Exploration of red black tree The content of this article is much simpler on the basis of red and black trees. set and map need to understand their structures. It's best to use them easily in the actual process of using STL.
Because the red black tree is used as the bottom layer, it sho ...
Posted by beboni on Tue, 30 Nov 2021 04:20:47 -0800
3.3 deque container
Disclaimer: This article is a note on learning C++ STL - standard template library, which is convenient for later review; Mainly refer to C++ Prime, C + + standard library Dark horse programmer's ingenuity | C + + tutorial: introduction to programming from 0 to 1 Wait.
3.3.1 basic concept of deque container
Posted by meritre on Fri, 19 Nov 2021 22:10:43 -0800
Node of list
list is more complex than vector's continuous linear space. Its storage space is discontinuous. The advantage is that each time an element is inserted and deleted, only one element's space needs to be configured or releasedIt is very convenient to insert and delete
Node of list
The list itself and the nodes of ...
Posted by cesar110 on Fri, 19 Nov 2021 03:56:43 -0800
1, Deep and shallow copy Shallow copy:
When implementing a string, if you do not copy the string first, a copy constructor will be automatically generated, but it is only a shallow copy. Two string objects point to the same address. When two objects call the destructor, the destructor called by the previous object has released the internal sla ...
Posted by magicmoose on Wed, 17 Nov 2021 08:28:58 -0800
The tragedy of test algorithm training
Time limit: 1.0s memory limit: 512.0MB
English preparation gzp is a funny (tu) than (hao). In order not to fail in the upcoming English quiz, gzp forgets to eat and sleep and reviews the English appendix word list, just like a human tragedy. But G ...
Posted by joyser on Thu, 11 Nov 2021 15:17:33 -0800
Implement your own iterator IIImplement a tree structure container, and then implement an STL style iterator instance for it.This article is for the last article How to implement user defined iterator Provide supplementary cases.tree_ Implementation of TI intend to implement a simple but not simple tree container and make it a standard contain ...
Posted by crochk on Sun, 31 Oct 2021 05:05:17 -0700
Implement a simple vector container
The implementation of all C++ STL containers needs to rely on a spatial configurator allocator. Although we don't pay attention to it when using containers, we have been using it all the time. The C++ STL library provides a simple implementation of the default spatial configurator allocator. Of course, we ne ...
Posted by robin on Sat, 30 Oct 2021 06:31:20 -0700
github address: GitHub - hlccd/goSTL
For some data structures with size comparison, it is very cumbersome to implement some size comparison every time. Especially for some officially set types, it will be simple to implement the comparison of their elements when introducing basic types into the data structure.
At the s ...
Posted by Richter on Mon, 18 Oct 2021 15:48:26 -0700
Allocator is one of the six components of STL, space configurator. Its function is to manage memory for each container (memory recovery). The allocator configuration object is not only memory, it can also ask for space from the hard disk. Here we mainly consider the memory management. When using STL library, we don't have to consid ...
Posted by niki77 on Sun, 10 Oct 2021 02:54:54 -0700