Tree -- implementation of attribute operation in general tree

1. The attribute operations in the tree are: 1, the number of nodes in the tree, the height in the tree, and the degree of the tree;        2. Number of nodes in the tree: 1, define function: count(node) 1. Count the number of nodes in the tree with node as the root node; 2, recursive implementation; 2. Function code implementation: ...

Posted by kriss37 on Mon, 04 Nov 2019 09:49:51 -0800

[deep understanding of polymorphism] from "Mom, I want to eat roasted yam"

Catalog 1. Recognition of polymorphism from eating roasted yam 2. Preconditions for polymorphism 3. Manifestation of polymorphism 4. Upward transformation 5. Downward transformation 6. Re analysis of upward and downward transformation 7. The subtlety between polymorphism and con ...

Posted by mr_badger on Sun, 03 Nov 2019 16:43:40 -0800

The prototype pattern of java design pattern: shallow clone and deep clone

Definition: prototype pattern is to use prototype instances to specify the type of objects to be created, and to create new objects by copying these prototypes. ​ In the application program, some objects are more complex, and the creation process is too complex, and we need to use the object frequently. If we new the object according to the con ...

Posted by zbee on Sun, 03 Nov 2019 15:35:09 -0800

Vue's Key attributes, v-for and v-if, v-if/v-show, v-pre do not render, v-once only renders once

key attribute Why add key -- api explanation The special attributes of key are mainly used in the virtual dom algorithm of vue. If key is not applicable, vue will use an algorithm to minimize dynamic elements and try to repair / reuse the same type of elements as much as possible. With key, it rearranges the order of elements based on the chan ...

Posted by michelledebeer on Sun, 03 Nov 2019 14:54:48 -0800

How to remove Youdao cloud note ads (windows)

I. applicable to versions before 6.0 You just need to: find the installation path of cloud notes, * \ Youdao\YoudaoNote\theme\build.xml Open the file with a notebook, find the words "advertisement in the lower left corner", and delete the following code: <PanelAd type="adpanel" css="public" ass="mainform panelclient PanelAd"> ...

Posted by Jarl on Sun, 03 Nov 2019 14:24:14 -0800

C + + basic learning

Summary based on an example code #include <iostream> #include <string> class Date { public: Date(unsigned int nYear , unsigned int nMonth , unsigned int nDay ); virtual ~Date(); void SetYear(unsigned int nYear); void SetMonth(unsigned int nMonth); void SetDay(unsigned int nDay); unsigned int GetYear(); unsigned ...

Posted by iamcaper on Sun, 03 Nov 2019 00:02:13 -0700

02 Tkinter label learning notes

Tag Label Label() is used to create a text or image label in the window.Usage: label (parent object, options,...). Common options parameters: (1) anchor: controls the label position. The default is CENTER. (2) bg: background color. (3) bitmap: use the default icon as the label content. (4) border width: the border width of the label. (5) compo ...

Posted by danrl on Sat, 02 Nov 2019 16:49:36 -0700

Day25 class related magic methods

1. Magic properties related to class #Get the internal member structure of an object or class#Get the internal doc ument of an object or class#Get class name function name#Class gets the class to which the current object belongs#Get all the parent classes directly inherited by a class, return tuples   2. reflection #Concept: use string to m ...

Posted by easmith on Sat, 02 Nov 2019 15:21:04 -0700

DOM operation based on HTML

DOM (Document Object Model) The display of a web page is a page composed of html tags. The dom object actually transforms html tags into a document object. You can find the html tags through the methods provided by js in the dom object. By finding the tag, you can operate the tag to make the page move and make the page move. Get Tags // Ge ...

Posted by jaydeesmalls on Sat, 02 Nov 2019 13:01:53 -0700

Interpretation of ArrayList source code

Interpretation of ArrayList source code attribute private static final int DEFAULT_CAPACITY = 10;//Default initialization space private static final Object[] EMPTY_ELEMENTDATA = {};//Empty array for empty object initialization private static final Object[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; transient Object[] element ...

Posted by The_Assistant on Sat, 02 Nov 2019 11:09:12 -0700