JavaSE02, array, reference, array copy, two-dimensional array
1. Three ways to define arrays
Array: a collection that stores a set of data of the same data type
public class TestDemo {
public static void main(String[] args) {
int[] array = {1,2,3,4,5,6,7}; // Array defined and initialization [] cannot put any numbers
// matters needing attention:
// 1. When defining ...
Posted by thatsme on Thu, 28 Oct 2021 16:13:25 -0700
Learning notes: Chapter 3 stack and queue
Chapter 3 stack and queue
Part I stack
1. Definition of stack
A stack is a linear table that is restricted to insert and delete operations only at the end of the table.
We call the end that allows insertion and deletion as the top of the stack, the other end as the bottom of the stack, and the stack without any data elements as an empty ...
Posted by westexasman on Thu, 28 Oct 2021 13:33:09 -0700
numpy hand tear logistic regression classification MNIST formula + code
brief introduction
Although logical regression bears the name of regression, it actually does classification. The general form of regression can be expressed as:
f
(
x
)
=
...
Posted by kernelgpf on Thu, 28 Oct 2021 06:23:22 -0700
diff algorithm in depth?
1, Foreword
A classmate asked: could you elaborate on the diff algorithm.
To put it simply: diff algorithm is an optimization method, which compares the difference between the two modules before and after, and the process of repairing (updating) the difference is called patch, also known as patching.
The article mainly solves the follow ...
Posted by Heywood on Thu, 28 Oct 2021 05:02:32 -0700
[naval International Program Office] Doorman
Doorman
Topic overview
Problem solution
Sister's favorite tree set tree optimization dp.
First, it should be easy to come up with a
d
p
dp
The idea of dp. As Niuniu has only two movements in the whole process, stay at the door, run ...
Posted by ShopMAster on Wed, 27 Oct 2021 20:15:42 -0700
Notes on ten classic sorting algorithms
Related concepts
stability
Stable: if a was in front of b and a=b, a will still be in front of b after sorting.Unstable: if a was originally in front of b and a=b, a may appear after b after sorting.
Time complexity
In general, the number of times the basic operation is repeated in the algorithm is a function of the problem scale n, which i ...
Posted by romano2717 on Wed, 27 Oct 2021 18:45:26 -0700
js data structure and algorithm learning stack queue single linked list
Understanding data structures
Data structure is a way for computers to store and organize data. A data structure is a collection of data elements that have one or more specific relationships with each other-- Baidu Encyclopedia We understand data structures from our own perspective.
Data structure is a way for computers to store and organize ...
Posted by misterfine on Wed, 27 Oct 2021 17:39:51 -0700
minimum spanning tree
Catalog
One, Kruskal
Two, the actual battle of Kruskal
POJ 2349 Arctic Network
Force buckle 1584. Minimum cost of connecting all points
Three, Prim
Fourth, Prim Actual Warfare
Force buckle 1584. Minimum cost of connecting all points
One, Kruskal
Algorithmic ideas:
Start to think of each point as a separate tree. Each ti ...
Posted by glassroof on Wed, 27 Oct 2021 10:33:59 -0700
Genetic algorithm example
Concepts of inheritance:
Genetic algorithm is a computational model that simulates the natural selection and genetic mechanism of Darwin's biological evolution theory. It is a method to search for the best solution by simulating the natural evolution process.
The characteristics of genetic algorithms:
Common features of search algorithms are ...
Posted by suresh64633 on Wed, 27 Oct 2021 10:03:46 -0700
Quick sort notes
Code template:
#include <iostream>
using namespace std;
const int N = 1000010;
int q[N];
void quick_sort(int q[], int l, int r)
{
if (l >= r) return;
int i = l - 1, j = r + 1, x = q[l + r >> 1];
while (i < j)
{
do i ++ ; while (q[i] < x);
do j -- ; while (q[j] > x);
if (i < ...
Posted by RoundPorch on Wed, 27 Oct 2021 09:20:31 -0700