C language - memory function

Memory function In C language, when a program is loaded into memory to run, the system will allocate an independent memory space for the program, and this memory space can be subdivided into many areas, such as stack area, heap area, static area, global area, etc Stack area: save local variables. The variables stored in the stack area will be ...

Posted by Cerberus_26 on Tue, 25 Jan 2022 22:48:09 +0100

luogu_1690 (greedy copy)

This is a very good shortest path + deep search exercise Question surface: Copy heard from Lu Niu that there are many treasures buried in a god field called yz, so copy came to this God land divided into regions. Lu Niu told me that there are treasures here, which are placed in the PI (1 < = Pi < = n) area. Copy also knows the distance ...

Posted by mark_18 on Tue, 25 Jan 2022 21:53:19 +0100

Communication management system

Communication management system 1. System requirements Address book is a tool that can record the information of relatives and friends. This tutorial mainly uses C + + to implement an address book management system The functions to be realized in the system are as follows: Add contact: add a new person to the address book. The information ...

Posted by jvquach on Tue, 25 Jan 2022 21:50:54 +0100

[C + +] [hash table] [hash function] implement its own hash table to solve hash conflicts; Dynamic Hash table;

preface 1. Introduction of hash table and hash function Just like this problem, with a 26 int array, you can hash map each character. The hash function is: f(char) = char -'a '; The hash table is the int [26]; This simple hash function handles the conversion from key to index, and it is also a simple one-to-one correspondence. The m ...

Posted by homer.favenir on Tue, 25 Jan 2022 21:20:43 +0100

C + + learning record 2 -- classes and objects

1, Classes and objects 1. Class and object concepts Everything is an object with attributes and methods. Objects with the same properties and methods (the same properties) can be abstracted as classes. Properties and objects in a class are collectively referred to as members Attributes are also called member attributes, and member variab ...

Posted by jacobsdad on Tue, 25 Jan 2022 18:17:01 +0100

C + + object model

C + + object model 1. What is the C + + object model? The C + + object model can be summarized into the following two parts: ① The part of language that directly supports object-oriented programming Object oriented programming: such as constructor, destructor, virtual function, inheritance (single inheritance, multiple inheritance, virtua ...

Posted by scald on Tue, 25 Jan 2022 17:51:03 +0100

Implement high-performance HashMap in specific scenarios

Efficiency problems in some scenarios of C + + standard library In the following scenario, the C + + standard library is unordered_map,map,multiset,unordered_multiset is not efficient. Group repetition count There are 100 million records with two columns: group_id, attribute, and the record has been recorded according to group_id is in order ...

Posted by vumpler on Tue, 25 Jan 2022 17:35:11 +0100

1015 theory of virtue and talent (25 points) 2 3 4 test points

1015 theory of virtue and talent (25 points) Sima Guang, a historian of the Song Dynasty, wrote a famous "theory of virtue and talent" in Zizhi Tongjian: "therefore, the perfection of talent and morality is called a saint, the death of talent and morality is called a fool, the victory of virtue is called a gentleman, and the vic ...

Posted by R0bb0b on Tue, 25 Jan 2022 16:24:22 +0100

Realize wonderful timer

In the past, I used to use timerfd when writing programs and timers, but would it be defective? If you need to create a lot of timers, you will create a lot of descriptors, and if you create a lot of timers, it will undoubtedly cause a lot of switching between user state and kernel state. Can you implement a set of timers in user state? This ca ...

Posted by genius on Tue, 25 Jan 2022 15:48:04 +0100

Linear discrete storage linked list in data structure

In the previous section, we have learned about continuous storage in linear storage. We also call this storage structure sequential table or array. We also know that linear continuous storage has the following advantages and disadvantages: Advantages: it can quickly add and access elementsDisadvantages: inserting or deleting elements will mo ...

Posted by JustinMs66 on Tue, 25 Jan 2022 15:39:16 +0100