1. Algorithm efficiency 1.1 Complexity of algorithm After the algorithm is written into an executable program, it takes time, resources and space to run. ( Memory ) resource . therefore Measuring the quality of an algorithm, generally Measured from two dimensions: time and space , namely time complexity and space complexity. Time complexity mainly measures […]
Tag: lex
[Elementary Data Structure] Time Complexity and Space Complexity of Algorithms
Hello readers! Now I will briefly talk about a basic knowledge point in data structure based on C language: the time complexity and space complexity of the algorithm. I hope it will be helpful to you. Table of Contents 1. What is a data structure? 2. What is an algorithm? 3. Time complexity 3.1 The […]
Algorithm time complexity and space complexity and space complexity
When we usually do math problems, there are simple methods and complex methods for the same problem. And the same goes for our computer programs. When an algorithm is written as an executable program, it requires time resources and space (memory) resources when running. Therefore, measuring the quality of an algorithm is generally measured from […]
Explore Miniconda3: a simple and flexible Python environment and software package management tool
Miniconda3 installation and configuration notes Foreword Miniconda3 is a lightweight Anaconda distribution that provides a flexible and simplified way to manage Python environments and packages. This article will introduce how to install, configure and manage Miniconda3, as well as use the conda command to manage the environment and software packages. Article directory Miniconda3 installation and […]
Network IO and IO multiplexing (select/poll/epoll) (1)
Tip: After the article is written, the table of contents can be automatically generated. For how to generate it, please refer to the help document on the right. Network IO and IO multiplexing (select/poll/epoll) (1) Preface 1. Network card 2. Network IO 1.Code Replenish 2. Use tcp/udp net assistant tool 3. Implement communication between the […]
Cordova series simplifies complexity: creating Cordova components suitable for all scenarios
Foreword In the opening chapter of my previous article A Preliminary Study of Cordova, I mentioned that one of the significant limitations of Cordova in Android application development is that our Activity must inherit the CordovaActivity provided by it. This design is particularly restrictive for projects that pursue personalized UI design. In fact, it is […]
Multiplexing (Part 1) – select
Table of Contents 1. Select interface 1. Understand the select system call 2. Understanding of each parameter 2. Write select server 1. Two tool categories 2. Network socket encapsulation 3. Server class writing 4. Source file writing 5. Run 1. select interface 1. Understand the select system call int select(int nfds, fd_set readfds, fd_set writefds, […]
Space complexity and time complexity of sorting algorithm
1. Time complexity and space complexity of sorting algorithm Sort Algorithm Average time complexity Worst time complexity Best time complexity Space complexity Stability Bubble sort O(n2) O(n2) O(n) O(1) ? Direct selection sort O(n2) O(n2) O(n2) O(1) ? Direct insertion sort O(n2) O(n2) O(n) O(1) ? Quick sort O(nlogn) O(n2) O(nlogn) O(nlogn) ? Heap sort […]
The nature of communication, communication methods, the principles and multiple characteristics of anonymous pipes (access control, pipe_buf, atomicity, half-duplex), pipe() + simulation implementation code, communication between multiple processes (anonymous pipes, simulation implementation code )
Table of Contents communication introduce Why should there be communication? the nature of communication How to communicate pipeline system V posix standard Signal pipeline introduce anonymous pipe Principle introduce process Implement — pipe() function prototype parameter return value mock code Features Used for communication between parent and child processes Provide access control When the buffer […]
Visitor Pattern – Manipulate complex object structures
There are many shops in the mall, which are roughly divided into clothing area, dining area and leisure area. Every day, there is an endless stream of people with different roles (workers, students, rich people) visiting the mall. The mall wants to develop a system to simulate the behavior of these people in these stores. […]