• ## Bit operation of leetcode

Time：2020-5-9

//Judge whether an integer is the nth power of 2 private boolean is2N(int num) { return (num & (num – 1)) == 0; } //To judge whether a positive integer is odd or even, it is not divided by 2 private boolean isEvenNumber(int num) { return (num & 1) == 0; } 338：https://leetcode-cn.com/probl… Given a […]

• ## Atcoder contextabc 136 D gathering children

Time：2020-4-8

subjectThere are small squares that can be represented by the string s consisting of the characters’ l ‘and’ R ‘.The length of string s is n, that is to say, string s is arranged in a row from left to right by n small squares. The content of the i-th cell from left to right […]

• ## Principle learning of HashMap implementation

Time：2020-2-24

Source code of HashMap: android-25 / Java / util / HashMap 1、 Construction method static final int MAXIMUM_CAPACITY = 1 << 30; static final int DEFAULT_INITIAL_CAPACITY = 4; static final float DEFAULT_LOAD_FACTOR = 0.75f; public HashMap() { this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR); } //Parameter default is 4,0.75f public HashMap(int initialCapacity, float loadFactor) { if (initialCapacity < 0) throw […]

• ## Self study in Java – mathematical methods of numbers and strings

Time：2020-1-22

Common methods of Java math class Java.lang.math provides some common mathematical operation methods, and they all exist in the form of static methods Step 1:Rounding, random number, square, power, π, natural constant package digit; public class TestNumber { public static void main(String[] args) { float f1 = 5.4f; float f2 = 5.5f; //5.4 rounding to […]

• ## Introduction to C Language 1 – Working Principle of Computer

Time：2019-9-12

Computer and Artificial Intelligence, Computer Systems: Working Principle of Computer:The basic principle of computer is to store program and program control. In advance, the sequence of instructions (called program) and the original data that command how the computer operates are transmitted to the computer memory through the input device. Each instruction specifies which address […]