Data Structure BASICS (16) and data structure basics 16Basic Terms of the tree
1. node: {Data Element + several branches pointing to the subtree}
2. node degree: number of branches (number of sub-trees)
3. Tree degree: the maximum degree of all nodes in the tree
4. leaf node: zero degree Node
5. branch nodes: nodes with a degree greater than zero (including the root and intermediate nodes)
6. (from the root
Data Structure BASICS (17), data structure basics 17
Features of binary sorting tree
The binary sorting tree is either an empty tree or a binary tree with the following features:
1. Each element has a key value, which cannot be repeated;
2. If its left subtree is not empty, the values of all nodes on the left subtree are smaller than the values of the root node;
3. If its right subtree is not empty, the val
Data Structure BASICS (19) and data structure basics 19Double Rotation
A single rotation problem sometimes occurs (as shown in ):
(If the child node [k1] on the inner side is too deep, moving it one way will not solve the problem)
So there is a double rotation.
Double rotation to the right:
1. First, take k1 as the axis, and k1 and k2 rotate to the left;
2. Take k3 as the axis, and k3 and k1 after rotat
Data Structure BASICS (18) and data structure basics 18
The red/black tree is a self-balancing binary search tree and a data structure used in computer science, A typical purpose is to associate arrays (map/set in C ++ STL ). It was invented by Rudolf Bayer in 1972. It is called the symmetric Binary Tree B. Its modern name is Leo J. guibas and Robert Sedgewick obtained in a paper written in 1978. Although t
Data Structure BASICS (15) and data structure basics 15
Base sorting is an internal sorting algorithm that uses the "Multi-Keyword sorting" idea to implement "Single-Keyword sorting.
There are two methods to sort multiple keywords:
Ranking priority (LSD)
First, sort K [0] {the smallest digit} of the base, and divide the record sequence into several subsequences based on different values of K (0, sort K [1 ,
Java Memory Model basics and java model Basics
Java Memory Model: 1Thread communication: 2Re-sorting: Program EfficiencyHappens-before: If yes, it will not be reordered.Memory barrier command: deprecated sortingData Dependency: a single thread exists and will not be rearranged.As-if-serial: ensures that the rescheduling has no effect on the results of a single thread.Data competition: Correct synchronizat
Python basics 6: formatting characters, colors, and python Basics
Character formatting:
1.% placeholder, % s, % d, %
2. Use format. The format is easy to use. It can be centered, %, binary, and character-filling;
1. Use Case of %
Tp1 = "I am % s" % "aaa "#Tp2 = "I am % s age % d" % ("alex", 18) # sequential AssociationTp3 = "I am % (name) s age % (age) d" % {"name": "alex", "age": 18} # specify the name a
Data Structure BASICS (1): Data Structure Basics
Simple implementation of Swap
// C language (by-pointer): template
// C ++ special method (by-reference): template
Summary:
Although we have implemented swap by ourselves, we recommend that you use the std: swap () function that has been implemented by C ++ STL. It is stored in the namespace std, use the following
Bubble-Sort)
Algorithm idea:
Scan data
Data Structure BASICS (12) and data structure basics 12
Features of two-way linked list operation:
(1) "query" is the same as a single-chain table;
(2) When "insert" and "delete", you must modify the pointer in both directions.
However, for a two-way cyclic linked list, inserting at the end of the table is very fast. It only takes O (1) time, because there is a pointer to the front, therefore, the two-way c
Data Structure BASICS (6): Data Structure Basics
Stack is a linear table that only allows insert or delete operations at one end. It features: first-in-first-out (FILO)/Second-in-first-out (LIFO );
Stack VS. Queue
The stack and queue are both dynamic sets, but in the stack, you can remove the recently inserted one: the stack implements a kind of "last-in, first-out) similarly, in the queue, the elements th
Data Structure BASICS (7): Data Structure Basics
Queue
A queue is also a linear table with limited operations. It can be inserted only at one end of the table and deleted at the other end of the table. it is characterized by "first-in-first-out (FIFO)", which is also known as the first-out linear table, simple queue:
Cyclic queue
There is an inherent deficiency in the ordered queue, that is, the space uti
Data Structure BASICS (4): Data Structure Basics
Fast sorting is the most popular and the fastest Sorting Algorithm (C ++ STL's sort function is to implement fast sorting); quick sorting) it is an improvement for Bubble sorting. Proposed by C. A. R. Hoare in 1962. Its basic idea is: Split the data to be sorted into two independent parts by one sort, and all the data in one part is smaller than all the data
MongoDB BASICS (9) sharding and mongodb Basics
Sharding stores data on multiple servers. Mongodb uses sharding to support deployment of very large datasets and high throughput operations. The capabilities of a single server are limited in various aspects, such as CPU, IO, RAM, and storage space. To solve the expansion problem, the database provides two methods: vertical expansion and sharding.
Vertical Sc
Lua basics [5] I/O file operations, lua Basics
-- [Lua file operation-related I/O] ---- You can specify to open a file in a specific directory. If the file does not exist, -- lua will help us create this file under the directory you specified, provided that the directory exists -- [we should also master the file writing mode; the following write mode is described: "r" Mode: Read mode (In this mode, only con
Java syntax BASICS (Summary), java syntax basics Summary
1. Keywords: words with special meanings given by a language.
Reserved Words: Actually, words that have not been given a special meaning but will be used in the future.
2. identifier: it is actually a custom term in the program. For example, class name, variable name, and function name. Contains 0-9, a-z, $, and ,_;
Note:
1), cannot begin with a numbe
Linux basics [Article 9] and linux basics Article 9
Architecture of adding three disks to the server
Note:
1. linux caches the physical memory that is not used by the system. Therefore, 859 is not the actual memory of the system.
2. The real available system memory is 921.
3. buffers is the write buffer, and sync writes the buffer data to the disk.
4. the cache is the buffer for reading data.
5. The hard
Linux BASICS (1), Linux BASICS (
1. Five methods available for installing linux
1. CD2. Hard Disk3. NFS Image4. FTP5. HTTP
There are two scenarios for hard disk installation:
A. It is installed on Win System
B. The installation is started from other Linux
This section describes how to install Windows in most people. The second method has not been called.
1. Install the system --- RedHat 9.0, (similar to tho
TCP/IP BASICS (I), tcpip Basics
1. Architecture and main protocols of TCP/IP protocol family
The TCP/IP protocol family is a layer-4 protocol system.
Data link layer: implements network drivers for Nic interfaces to process data transmission on physical media (such as Ethernet and Token network. The two common protocols on the data link layer are ARP (Address Resolve Protocol) and RARP (Revers Address Reso
Oracle BASICS (1), Oracle BASICS (
Oracle Database System is a group of software products with distributed databases as the core provided by Oracle in the United States. It is currently the most popular Client/Server) or one of the databases in the B/S architecture. For example, Oracle database is the most widely used database management system in the world. As a common database, it has complete data manage
[Java Basics] common knowledge accumulation (1), java basics Accumulation
1. Difference Between = and equals: difference between null and ""
2. 15 top-level Java multi-thread Interview Questions and answers
(1) Use of join in a thread
In many cases, the main thread generates and starts a subthread. If a large number of time-consuming operations are required in the subthread, the main thread usually ends bef
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.