[C + + improve programming] 3.8 STL common container: map/multimap container

1. string container Please click to jump to this chapter 2. vector container Please click to jump to this chapter 3. deque container Please click to jump to this chapter 4. stack container Please click to jump to this chapter 5. queue container Please click to jump to this chapter 6. list container Please click to jump to this ch ...

Posted by Jaehoon on Sun, 27 Feb 2022 16:47:37 +0100

Data structure - queue

Characteristics of queue First in first out (FIFO) Queue is called queue because of its characteristics. It's very similar to the queue in the supermarket, isn't it? The front keeps walking and the back keeps up In the queue, you can only insert at the back and delete at the front. The insert operation is also called enqueue, and the delete ...

Posted by skeener on Sun, 27 Feb 2022 13:19:52 +0100

Chapter 3 linear table

Chapter 3 linear table Definition of linear table Linear List: a finite sequence of zero or more data elements. Emphasis: first, it is a sequence. Then emphasize that the linear table is limited. (direct) precursor element, (direct) successor element. The number of linear table elements n(n ≥ 0) is defined as the length of the linear ta ...

Posted by razorsedgeuk on Sun, 27 Feb 2022 09:48:46 +0100

Copy assignment function of [C + +] class

Reprint [to] C + + assignment constructor (assignment operator overload) Note: the content of the article is not strictly verified. Please leave a message if you have any questions or errors. When an object of a class assigns a value to another object of the class, the assignment constructor of the class will be used. When the assignment con ...

Posted by fuzzy1 on Sun, 27 Feb 2022 09:38:25 +0100

Simulation of common string functions and memory functions

@[TOC] (directory) catalogue Purpose of this chapter strlen Simulation Implementation Implementation of strcmp simulation Implementation of strcat simulation strcpy Simulation Implementation Implementation of STR simulation Implementation of strncmp simulation Implementation of strncat simulation Implementation of strncpy simulation ...

Posted by IRON FART on Sun, 27 Feb 2022 09:36:45 +0100

Sort - quick sort (fast and slow pointer Implementation)

The two solutions of too fast scheduling summarized before can be used as a reference Two common solutions of fast scheduling Recently, I found another method that is easier to understand. Make a record here. This is a method of using "fast and slow pointer comparison" to realize the fast sorting algorithm. The key to realize the qu ...

Posted by dnoonan on Sun, 27 Feb 2022 05:13:03 +0100

Section 7 of C + + after the initial stage - polymorphism

Our task in this section is to find out the polymorphism catalogue 1, Concept of polymorphism 2, Override (overwrite) of virtual function: 3, override and final in C++11 Keyword override: Keyword: final Comparison: overload, overwrite (override), hide (redefine) 4, Abstract class concept Interface inheritance and implementation inhe ...

Posted by futurshox on Sun, 27 Feb 2022 04:05:10 +0100

C++ decltype type derivation

reference 1,http://c.biancheng.net/view/7151.html Both auto and decltype keywords can automatically deduce the type of variable, but their usage is different: auto varname = value; decltype(exp) varname = value; Where varname represents the variable name, value represents the value assigned to the variable, and exp represents an expression ...

Posted by Unipus on Sun, 27 Feb 2022 01:34:27 +0100

L2-016 wish all lovers in the world are brothers and sisters who have been separated for many years (25 points)

L2-016 wish all lovers in the world are brothers and sisters who have been separated for many years (25 points) ha-ha. We all know that intermarriage is not allowed within five clothes, that is, if the nearest common ancestor of two people is within five generations (i.e. myself, parents, grandparents, great grandparents and high grandparents), ...

Posted by WickedStylis on Sat, 26 Feb 2022 17:21:51 +0100

C/C + + programs read (save) data from text files

In C program: When dealing with data (files) outside the program code, we use the concept of stream to realize the data exchange between the process's virtual memory and files. ——FILE stream: the C standard library provides FILE (named FILE because linux treats all mechanisms as files). The FILE object is a structure that contain ...

Posted by bqheath on Sat, 26 Feb 2022 16:20:47 +0100