java written test questions and answers (for reference only)
1. Operator priority. What is the result of the following code?
public class Test {
public static void main(String[] args) {
int k = 0;
int ret = ++k + k++ + ++k + k;
// What is the value of ret
System.err.println(ret);
}
} Answer: mainly investigate the difference between + + i and i + +. ++In the first place, the v ...
Posted by 3dron on Mon, 04 Nov 2019 22:33:52 -0800
[template] minimum spanning tree [minimum spanning tree] [prim kruskal]
prim:
First, build a tree with only one node, which can be any node in the original graph
Using an edge to expand the tree requires that one vertex of the edge is in the tree and the other vertex is not in the tree, and the weight of the edge is the minimum.
Repeat step 2 until all vertices are in the tree
Look at the teacher's template ...
Posted by hardyvoje on Mon, 04 Nov 2019 13:38:10 -0800
POJ2411 Mondriaan's Dream
Yes, I plagiarized this question from LZL's blog. His question is really good and fragrant.
Title Link: http://poj.org/problem?id=2411
Main idea: for a rectangle of n * m, how many ways are there to fill the rectangle with 1 * 2 small squares. (1<=n, m <= 11)
Train of thought:
1. With the experience of problem-solving, I can thi ...
Posted by kataras on Mon, 04 Nov 2019 10:10:22 -0800
codeforces 514E-Darth Vader and Tree
There is an infinite tree with roots. Each node has N children. The distance between each child and the parent node is di. Find the number of nodes whose distance from the root node is less than or equal to X
Idea: pay attention to the observation data range, each d[i] is less than or equal to 100, so we can set dp[i] to represent the numbe ...
Posted by AcidCool19 on Mon, 04 Nov 2019 09:09:40 -0800
HDU-1231 - maximal continuous subsequence - algorithm note
Title Link: http://acm.hdu.edu.cn/showproblem.php?pid=1231
Problem Description:
Given the sequence of K integers {N1, N2 , NK}, any continuous subsequence of which can be expressed as {Ni, Ni+1 ,
Nj}, where 1 < = I < = J < = K. The largest continuous subsequence is the element sum of all the continuous s ...
Posted by nick2005 on Mon, 04 Nov 2019 08:50:20 -0800
Read the operating system boot program roughly
[1] linux 0.11 bootsect.s
Copy the contents of the memory segment [0x07c00, 0x07e00) to the memory segment [0x90000, 0x90200],
Then jump to 0x9000 segment to execute the program that is not executed after bootdetect. S.
The subsequent program of bootsec. S will start the setup.s program in the disk (floppy disk) into ...
Posted by phpbrat on Sun, 03 Nov 2019 13:58:32 -0800
How to integrate Mybatis with Spring? The source code is not difficult!
Spring integrates Mybtais with the following configuration (all roads lead to Rome, and the way is not unique).
private static final String ONE_MAPPER_BASE_PACKAGE = "com.XXX.dao.mapper.one";
@Bean
public MapperScannerConfigurer oneMapperScannerConfigurer() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
...
Posted by wilded1 on Sun, 03 Nov 2019 03:50:38 -0800
java implements the function of file download (attach the code that can be actually run)
Recently, I am working on a project, which involves file download and package compression download. Single file download is relatively simple. Multi file download involves package and compression knowledge, which I haven't done before. Write a blog to make a simple record. Less gossip, code:
The fol ...
Posted by Drannon on Sun, 03 Nov 2019 02:41:08 -0800
Java ArrayList underlying implementation principle source code detailed analysis of Jdk8
brief introduction
ArrayList is a dynamic array based on array. Its capacity can grow automatically. It is similar to the dynamic application memory and dynamic growth memory in C language.
ArrayList is not thread safe and can only be used in a single thread environment. In a multi-threaded environment, you can consider using the collections. ...
Posted by Zjoske on Sun, 03 Nov 2019 01:02:52 -0700
python:while loop statement and exercises
while loop sentences and exercises
In Python programming, the while statement is used to execute a program circularly, that is, under certain conditions, to execute a certain program circularly to handle the same tasks that need to be handled repeatedly. Its basic form is: while judgment condition: execute statement... The execute statement ca ...
Posted by johnrcornell on Sat, 02 Nov 2019 22:32:44 -0700