Source code interpretation of ArrayList

Properties of class public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable { // Version No private static final long serialVersionUID = 8683452581122892189L; // Default capacity private static final int DEFAULT_CAPACITY = 10; // Empty obje ...

Posted on Mon, 04 May 2020 10:03:56 -0400 by mise_me_fein

Computer room charging system (4)

Recently, the computer room charging system has entered the final sprint period. The most core part of the computer room charging system is the up and down buttons. At first, I always felt dizzy. I didn't know how to design the codes of these two buttons. But with the help of many students, I finally figured out the logic and completed the desi ...

Posted on Mon, 04 May 2020 03:45:29 -0400 by kurdishvoice

Code + first monthly match B. Timberlake (two points)

Title Description There are n trees. At the beginning, the height of each tree is Hi. The ith tree grows Ai every month. Now there is an order with the total length of wood S. The customer requires that the length of each piece of wood should not be less than 50. And the wood must be the whole tree (i.e. not part of the tree). Now ask h ...

Posted on Mon, 04 May 2020 01:30:15 -0400 by billf

C × basis: data type

1. The first C program using System; namespace base_01 { class Program { #region code collapse block static void Main(string[] args) { //console output Console.WriteLine("Hello World!"); Console.Write("C#Microsoft programming language "; / / no line feed output ...

Posted on Sun, 03 May 2020 16:12:38 -0400 by BeanoEFC

SSL-ZYC irrigates farmland

Main idea: Due to the recent lack of rainfall, farmer John decided to build a water supply network between his N fields. The location of each block can be represented by a two-dimensional coordinate (xi,yi). If a pipeline is built between block i and block j, the cost is (xi - xj)^2 + (yi - yj)^2. ...

Posted on Sun, 03 May 2020 16:02:45 -0400 by Dan911

mp3 format to wav format with complete C + + algorithm implementation code

Recently, I came across an open source project, minimp3 Minimalistic MP3 decoder single header library Project address: https://github.com/lieff/minimp3 The minimum mp3 decoder with single file header. I always want to take time to have a good look. The best way to learn is to write a practical engineering project. For example, mp3 to wav forma ...

Posted on Sun, 03 May 2020 12:19:33 -0400 by jestercobblepot

Interpretation of HashMap source code (gradual improvement)

1. Initialization HashMap map= new HashMap(16); Initial value static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 Maximum static final int MAXIMUM_CAPACITY = 1 << 30; Load factor static final float DEFAULT_LOAD_FACTOR = 0.75f; The threshold value of chain table to tree static final int TREEIFY_THRESHOLD = 8; Th ...

Posted on Sun, 03 May 2020 10:20:51 -0400 by quad

Detailed notes on getting started with MySQL database

ps: The contents in brackets [] can be omitted and added as required Database operations Create database Syntax: create database [if not exists] data name charset=gbk; create database if not exists tow charset=gbk; Query OK, 1 row affected If not exists - > judge whether it is repeated Charset = GBK - > simplified Chinese Simplifi ...

Posted on Sun, 03 May 2020 09:04:02 -0400 by Farside

c language review - Practice

1. Judge whether a number can be decomposed into the sum of two prime numbers #include<stdio.h> #include<math.h> int isPrime(int x); int main() { int num=0,x=1,flag=0; printf("Please enter an integer(must be greater than 1):"); scanf("%d",&num); if(num<=1) printf("Please re ...

Posted on Sun, 03 May 2020 08:39:38 -0400 by ysu

bzoj1901 Zju2112 Dynamic Rankings (Chairman tree can be modified)

Description Given a sequence of N numbers a[1],a[2],a[3] a[n], the program must answer the question: for a given i,j,k, in a[i],a[i+1],a[i+2] What's the smallest number in a[j] (1 ≤ k ≤ j-i+1), and you can change some values of a[i]. After the change, the program can continue to answer the above questions for the changed a. Input The ...

Posted on Sat, 02 May 2020 22:28:38 -0400 by michibk