Summary of sword finger offer (c + +)

Some are official explanations or better ideas of others, and some are written by themselves. Prepare to brush questions while sorting out, only as your own study notes! 1. Array JZ1. Search of two-dimensional array Title Description In a two-dimensional array (each one-dimensional array has the same length), each row is sorted in asc ...

Posted by Ab on Sun, 08 May 2022 06:13:08 +0300

C + + -- analog implementation of string

1, Define my_string class #include<iostream> #include<assert.h> #include<string> using namespace std; class my_string{ private: char* _ptr; //character string size_t _size; //Number of valid characters size_t _capacity; //capacity static size_t npos; //size_ Maximum number in type T (indicates - 1) ...

Posted by David-fethiye on Sun, 08 May 2022 06:12:56 +0300

PAT_ Class A_ 1053 Path of Equal Weight

Main idea of the title: Given a tree and the weight of each node, find the path from all root nodes to leaf nodes, so that the sum of the weight on each path is equal to the given constant S. if there are multiple paths, output according to the non increasing sequence of paths Algorithm idea: Considering the traversal of the tree, since it is n ...

Posted by laurton on Sat, 07 May 2022 14:01:39 +0300

spi daisy chain communication of ad5764

There are four dac chips, two ad5762 and two ad5764 on an analog board. Finally, the hardware spi of mcu is used for daisy chain communication. It can be seen that after the spi sdo of mcu enters the sdin of u29 ad5762, the sdo of u29 ad5762 enters the sdi of u57 ad5762, and so on. Finally, from the sdo of u69 ad5764 into the sdin of mcu, a ...

Posted by markl999 on Thu, 05 May 2022 10:08:13 +0300

Interview question brushing algorithm oj-3

Oj599: sum of two numbers 1 Title Description Given an array from small to large and a target number t, find two numbers in it, make the sum of the two numbers equal to the target number, and output the position of the two numbers in the array. input The first line contains two integers n,t. (1≤n≤1000000,1≤t≤20000000) The num ...

Posted by dearmoawiz on Wed, 04 May 2022 17:56:02 +0300

Implementation of simple calculator in computer software technology practice

Implementation of simple calculator in computer software technology practice Test requirements: Learn the design of graphical interface, use MFC application (Java swing or QT framework, or C#) to create dialog based application, and add buttons, edit boxes and other controls; It can input and realize simple arithmetic operation through the d ...

Posted by juhl on Wed, 04 May 2022 07:17:37 +0300

C + + improve programming

1. Programming ideas in c + + (1) Object oriented programming (2) Generic programming: it mainly uses technical templates for programming 2. Template (1) Characteristics ① It can't be used directly. It's just a framework ② The universality of templates is not omnipotent, that is, a template is not used in all occasions (2) Function template ① T ...

Posted by cbassett03 on Wed, 04 May 2022 06:45:49 +0300

PAT (Level A) Fall 2020 Exam 7-4 Professional Ability Test

7-4 Professional Ability Test (30 points) Professional Ability Test (PAT) consists of several series of subject tests. Each test is divided into several levels. Level A is a prerequisite of Level B if one must pass Level A with a score no less than S in order to be qualified to take Level B. At the mean time, one who passes Level A with a scor ...

Posted by CodeEye on Wed, 04 May 2022 05:57:26 +0300

getopt() function analysis and command line analysis

When running executable programs under Linux, it is generally necessary to take specific parameters to specify the operation mode. The passed in parameter content is parsed by using getopt() function, and its header file is < unistd h>. Let's introduce the prototype of getopt in detail: int getopt(int argc,char * const argv[ ],const ch ...

Posted by alex57 on Tue, 03 May 2022 19:26:41 +0300

PAT (Level A) Autumn 2020 7-1 Panda and PP Milk

7-1 Panda and PP Milk (20 points) PP milk is Pandas' favorite. They would line up to enjoy it as show in the picture. On the other hand, they could drink in peace only if they believe that the amount of PP milk is fairly distributed, that is, fatter panda can have more milk, and the ones with equal weight may have the same amount. Since they ...

Posted by mallen on Tue, 03 May 2022 19:00:45 +0300