What is tail recursion?

50% of algorithm problems can be solved by recursion, which is not to say how powerful recursion itself is, but to say that recursion makes many complex problems simple! Why? People who understand data structure know that tree structure itself is defined by recursion What is tail recursion? As we all know, recursion will record ...

Posted by redsox8185 on Tue, 31 Mar 2020 17:15:08 -0700

Python learning notes (8) Python list (2)

List function Append and expand list.append() appends a new object to the end of the list 1 >>> dir(list) #Dirfunctions for viewing lists 2 ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', ...

Posted by TheWart on Tue, 31 Mar 2020 13:48:32 -0700

Conquer python3 function

function Functions are organized, reusable code snippets that implement a single, or associated function. 1. Definition of function def test(): #function print("in the test") return 0 def test1(): #process print("in the test1") x=test() y=test1() print(x) print(y) 2. Significance of using ...

Posted by owned on Tue, 31 Mar 2020 11:13:47 -0700

Related use of Python requests Library

Related use of requests Library More dry cargo Distributed Combat (dry goods) spring cloud combat (dry goods) mybatis combat (dry goods) spring boot combat (dry goods) React introduction actual combat (dry goods) Building a small and medium-sized Internet enterprise structure (dry goods) python learning continuous update Elast ...

Posted by aron on Tue, 31 Mar 2020 10:35:58 -0700

Data structure and algorithm linked list(03)

Continue with the algorithm of linked list:   Delete duplicate elements in sorted list Given a sort list, delete all duplicate elements so that only one is left for each element.   Case study: Given 1 - > 1 - > 2, return to 1 - > 2 Given 1 - > 1 - > 2 - > 3 - > 3, return to 1 - > 2 - > 3   Solutions: This problem is v ...

Posted by jspodisus on Tue, 31 Mar 2020 10:06:24 -0700

Compile and install vim8 under centos7, and support python3

1. Install python3 vim7.4 and python2.7 are installed by default in CentOS 7. Now we want to install vim8 and make it support python3. First of all, you need to install python3 in the system. For specific installation steps, please refer to my previous blog: https://blog.csdn.net/geerniya/article/details/79263846 2. Compile ...

Posted by ltd on Tue, 31 Mar 2020 05:04:47 -0700

Python web crawler notes (3): Download blog garden essay to Word document

(1) Description Based on the previous one, we use lxml to extract the body content of blog garden essay and save it in Word document. The following modules are used to operate Word documents: pip install python-docx Modified code (mainly added the following paragraph in the while loop of link_crawler()) 1 tree = lxml.html.fromstring(h ...

Posted by phpDVWeaver on Tue, 31 Mar 2020 01:56:38 -0700

python learning note 4

Chat 6 set a = set([1, 2, 3, 1]) a = {1, 2, 3, 4} b = {3, 4, 5, 6} # Create set a.union(b) a | b a.intersection(b) a & b a.difference(b) a - b a.symmetric_difference(b) a ^ b a = {1, 2, 3} b = {1, 2} b.issubset(a) b <= a a.issuperset(b) a >= b # In fact, there are > < symbols to use here Relative to list, append is used to add, ...

Posted by contex on Mon, 30 Mar 2020 23:21:35 -0700

Python3 Standard Library: Multprocessing manages processes like threads

1. Multprocessing manages processes like threads The multiprocessing module contains an API that is based on the threading API and divides work into multiple processes.In some cases, multiprocessing can replace threading as a temporary replacement to utilize multiple CPU cores, thereby avoiding computing bottlenecks caused by Python global inte ...

Posted by laurton on Mon, 30 Mar 2020 18:55:34 -0700

vnpy source reading learning: about app

About app In the entry program, we see gateways, apps, and various types of engines added to mainEngine.It is not difficult to guess that gateway mainly deals with external situations, interface code in all aspects, and it is not difficult to see that Engine is the core of vnpy through other people's articles, and can handle all aspects such as ...

Posted by _spaz on Sun, 29 Mar 2020 21:24:55 -0700