PTA stack (bracket matching)

#include<bits/stdc++.h> using namespace std; #define STACK_INIT_SIZE 10000 #define STACKINCREMENT 10 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 using namespace std; typedef char SElemType, Status; typedef struct { SElemType *ba ...

Posted by yumico23 on Sun, 08 Dec 2019 11:28:36 -0800

Calculation of determinant of triple matrix (recursion)

1. Specific ideas: There are two main methods for calculating matrix determinants: 1. Recursive calculation according to the definition of residential determinant 2. First transform the matrix row to upper triangular matrix, and then find the determinant.   (I first thought about the transformation of row into triangle matrix, but I met some pr ...

Posted by El Zagna on Sun, 08 Dec 2019 07:06:26 -0800

[most detailed in history] traverse Windows files

File traversal abstractWindows file traversal and process traversal are very similar. If you don't understand the process traversal suggestions, take a look at my previous two articles Traverse system process and Traversal system process module ! To traverse a file, you need to know the structure of Win32? Find? Data and the API GetCurrentDirec ...

Posted by Cailean on Sun, 08 Dec 2019 05:27:14 -0800

The essence analysis of 27 μ array

The concept of array Array is the order of variables of the same type Size of array Array stores data in a continuous memory space The number of array elements can be displayed or implicitly specified int a[5] = {1, 2};int b[] = {1, 2}; Question: What is the value of a[2], a[3], a[4]? How many elements does b contain? Programming experiment ...

Posted by SnakeO on Fri, 06 Dec 2019 14:51:13 -0800

Order table of C + data structure and algorithm

1. definition The sequential storage of a linear table is called a sequential table. Elements are adjacent to each other in logical relationship and memory address; random access is supported, and each element in the table can be accessed through subscripts. 2. Structure definition #define MaxSize 50 typedef struct { int data[MaxSize]; int len ...

Posted by eyespark on Fri, 06 Dec 2019 00:30:32 -0800

C language -- multiplication of two large numbers

Example: product of 9876543210 * 1234567890 Analysis: the normal data structure can no longer meet the result of such a large number multiplication. Only arrays can be used for operations. 1. Both numbers are received by character array. 2. After receiving, because each bit is multiplied by each bit of another number, The position of array subs ...

Posted by jrbush82 on Thu, 05 Dec 2019 18:01:11 -0800

Simple application of stack and linear table - conversion of number system

Stack structure has the characteristics of last in, first out, and is a useful tool in programming Let's take a look at the process of base conversion as shown in the figure: It can be seen that the integer part conforms to the characteristics of LIFO, and the stack structure can be applied Fractional FIFO, linear table can be applied sqstack. ...

Posted by ubuntu-user on Thu, 05 Dec 2019 05:12:02 -0800

Program example (beginner)

Example 1: calculate the approximate value of π with the formula π / 4 = 1-1 / 3 + 1 / 5-1 / 7 +... Until the absolute value of a term is less than 10 ^ 6. Tips: (1) to determine the accuracy of the calculation, you can use the fabs() function with the while loop statement to determine the accuracy to exit. (2) it is observed that the num ...

Posted by sheila on Wed, 04 Dec 2019 18:11:06 -0800

17 + + and -- operator analysis

++And -- the essence of operators ++And -- operators correspond to two assembly instructions Preposition Variable increment (decrement) 1 Take variable values Postposition Take variable values Variable increment (decrement) 1 ++And -- operator usage analysis A troubling pair of brothers int i = 0; (i++) + (i++) + (i++);(++i) + (++ ...

Posted by Eskimo on Mon, 02 Dec 2019 22:31:37 -0800

C ා detailed explanation of simple interface and inheritance example -- quick start

We talked about inheritance in the last article, but in fact, they are similar. An interface is an abstraction of a method. If different classes have the same method, you should consider using an interface. In C, interfaces can inherit from each other and from each other. A class can inherit one class and multiple interfaces at the same time, b ...

Posted by CoolAsCarlito on Mon, 02 Dec 2019 19:19:15 -0800