Program apes are very lazy, you know!What we are sharing today is the integer wrapper class. In real-world development, we often need to operate an integer, or a variety of conversions and so on. I will give you a specific explanation of the use of
Basic Concepts
The level of a node is defined from the root. The root layer is the first layer, and the child of the root layer is the second layer.
The height of a binary tree: the maximum level of a node in the tree is called the depth or height
Explanation: mutual conversion of binary, octal, decimal, and hexadecimal values: in addition to the remainder of 2, the integers are arranged in reverse order, that is, each time an integer is divided by 2, and the remainder is the number on the
In the world of Calculators 2 is the mainstream, and in the natural world of human 10 is the mainstream, then there will inevitably exist in the transformation of the problem. In this chapter we will talk about the transformation of the system, but
The conversion between decimal and binary
(1) Decimal conversion to binary, divided into integers and decimal parts
① integral number of parts
Method: In addition to 2, in reverse order, that is, each part of the integer divided by 2, the
One, the conversion between decimal and binary (1) Decimal conversion to binary, divided into integers and fractional parts ① whole number of parts Methods: In addition to the 2 method, that is, each time the integer part divided by 2, the remainder
odd-even segmented arrays
Splits an array of integers so that the odd number is behind the first even number. Sample Example
Given [1, 2, 3, 4], return [1, 3, 2, 4]. algorithm
This problem is still relatively simple, the method is many, we will
one or 10 conversion between binary and binary(1) Decimal conversion to binary, divided into integers and fractional parts① Integer PartMethods: In addition to the 2 method, that is, each time the integer part divided by 2, the remainder is the
One, the conversion between decimal and binary(1) Decimal conversion to binary, divided into integers and fractional parts① whole number of partsMethods: In addition to the 2 method, that is, each time the integer part divided by 2, the remainder is
Integer source code to binary to hexadecimal, integer source code
There is a private method, where toUnsignedString (int I, int shift) isPublic static String toHexString (int I ){Return toUnsignedString (I, 4 );}Public static String toBinaryString (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.