Huffman coding (data structure tree, c language version)

Huffman coding (data structure tree, c language version) 1, Experimental topic 1) Initialization. Read in the weight of each character and establish HuffTree; 2) Code. Coding with the built Huffman tree; 3) Output. Display the established Huffman tree and the corresponding coding table; 1. Data structure //----- storage representation of Hu ...

Posted by akrocks_extreme on Tue, 16 Nov 2021 06:20:09 -0800

Talk about HashMap 02 of jdk1.8

HashMap capacity expansion mechanism Previous review: Talk about HashMap 01 of jdk1.8 Last time we finished the put method, there was a way I did not elaborate, that is resize() method, which I personally think is the most beautiful but the most difficult part of HashMap. Next we will explain it slowly. Review the member variables transient ...

Posted by ntsf on Tue, 16 Nov 2021 06:11:03 -0800

Constructor and destructor of single inheritance derived class

#include <iostream> #include <cstdio> #include <cmath> #include <climits> #include <iomanip> #include <windows.h>// #include <iostream> #define MAX(x,y) (x)>(y)?(x):(y) #include <string.h> using namespace std; class A { public: A() { a=0; co ...

Posted by blackwidow on Tue, 16 Nov 2021 05:17:43 -0800

SPRINGBOOT02_ Introduction to automatic configuration principle, Lombok, dev tools, quick initialization boot project

① . view the main startup class as a whole ① . main startup classes are as follows: @SpringBootApplication public class MainApplication { public static void main(String[] args) { SpringApplication.run(MainApplication.class, args); } } ② 2. Key analysis @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan @Ta ...

Posted by GarroteYou on Tue, 16 Nov 2021 05:06:10 -0800

Kotlin announces a super feature

Kotlin 1.5 announced a blockbuster feature   value class, which is a very practical feature to improve code readability and performance, because the compiler will further optimize it and reduce the creation of objects. With the continuous improvement of Kotlin, a series of features have emerged   inner class  ,  data class ...

Posted by Helljumper on Tue, 16 Nov 2021 04:59:30 -0800

Analysis of NUMA mechanism

What is NUMA? NUMA (non uniform memory access) refers to Non-Uniform Memory Access. In order to better explain what NUMA is, we need to talk about the background of NuMA's birth. Background of NUMA's birth In the early stage, all CPUs access memory through the bus. At this time, all CPUs access memory "consistently", as shown in th ...

Posted by beta0x64 on Tue, 16 Nov 2021 04:17:22 -0800

Android 11 compiles the kernel real-time output log

How to make the log output in real time when Android compiles the kernel?[android 11][qcom 8155 gvmq][ninja 1.10.2.git][android ninja 1.9.0.git]backgroundIt takes more than ten or twenty minutes to compile make bootimage for development. During this period, there is no log real-time output for a long time. It looks like it is output after compi ...

Posted by pkSML on Tue, 16 Nov 2021 04:07:56 -0800

An article to understand ThreadLocal

How does ThreadLocal ensure that objects are only accessed by the current thread?Let's dig into the internal implementation of ThreadLocal.Naturally, we need to focus on the set() method and get() method of ThreadLocal.setLet's start with the set() method: /** * Sets the current thread's copy of this thread-local variable * to the ...

Posted by MickeySox on Tue, 16 Nov 2021 04:03:40 -0800

P7011-[CERC2013]Escape [heap, heuristic merge]

Topic Title Link: https://www.luogu.com.cn/problem/P7011 General idea of the topic give n n A tree with n points starts from one and goes to t t t. The initial weight value is ...

Posted by nosmasu on Tue, 16 Nov 2021 03:55:50 -0800

Getting started with JavaEE and Mybatis

1: Introductory case 1: First create a new module = = > set the Java version to 8 = = > find the following components, check and Finish 2: Write the structure as shown in the following figure controller layer UserController class ​ package com.mybatis.mybatis.controller; import com.mybatis.mybatis.entity.User; import com.mybatis ...

Posted by fansa on Tue, 16 Nov 2021 03:49:22 -0800