In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the basic knowledge of C language", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "what are the basic knowledge of C language"!
1.1 algorithm
Algorithm: An accurate and complete description of a solution.
Basic features of the algorithm:
(1)Feasibility: The algorithm can be executed accurately in principle, and it can be completed after a limited number of calculations with paper and pen.
(2)Determinism: Each step in the algorithm must be clearly defined, and ambiguous and ambiguous interpretations are not allowed.
(3)finiteness: the algorithm must be able to complete in a finite time, that is, it can terminate after performing a finite number of steps, including the meaning of reasonable execution time;
(4)Have enough information: usually refers to input and output.
The basic elements of the algorithm: one is the operation and operation of the data object; the other is the control structure of the algorithm.
Basic operations on data objects include arithmetic operations, logical operations, relational operations, and data transmission.
The control structure of the algorithm includes sequence structure, selection structure and cycle structure.
Basic algorithm design methods: enumeration, induction, recursion, recursion, halved recursion technology, backtracking method.
Algorithm complexity: algorithm time complexity and algorithm space complexity.
Algorithm time complexity refers to the amount of computational effort required to execute an algorithm.
Algorithm space complexity is the memory space required to execute the algorithm.
1.2 Basic concepts of data structure
Three aspects of data structure research:
(1)The inherent logical relationship between data elements in a data set, i.e. the logical structure of the data;
(2)When processing data, the storage relationship of each data element in the computer, that is, the storage structure of the data;
(3)Operations performed on various data structures.
A data structure is a collection of interrelated data elements.
The logical structure of the data consists of:
(1)information representing data elements;
(2)Represents the context relationships between data elements.
The logical structure of data is a description of the logical relationships between data elements.
Common data storage structures include sequence, link, index, etc.
Linear structure conditions:
(1)There is only one root node;
(2)Each node has at most one antecedent and at most one consequent.
Nonlinear structure: A data structure that does not satisfy the linear structure condition.
1.3 Linear table and its sequential storage structure
A linear table is composed of a set of data elements, the position of which depends only on its own serial number, and the relative position between elements is linear.
In complex linear tables, data elements composed of several data elements are called records, while linear tables composed of multiple records are also called files.
Structural characteristics of nonempty linear tables:
(1)There is only one root node and no antecedent.
(2)There is only one terminal node and it has no successor.
(3)All nodes except root and terminal nodes have one and only one antecedent and one and only one consequent.
The number of nodes n is called the length of the linear table, and when n=0, it is called an empty table.
The sequential storage structure of a linear table has two basic characteristics:
(1)The storage space occupied by all elements in the linear table is continuous;
(2)The data elements in a linear table are stored sequentially in logical order in the storage space.
Common operations on sequential tables are insertions and deletions.
1.4 stacks and queues
A stack is a linear list limited to insertion and deletion at one end. The end allowing insertion and deletion is called the top of the stack, and the other end not allowing insertion and deletion is called the bottom of the stack.
Stacks organize data according to FILO or LIFO and have memory. The top of the stack is indicated by top, and the bottom is indicated by bottom.
The basic operations of the stack:(1) insert elements called stack operations;(2) delete elements called stack operations;(3) read stack top element is to assign the stack top element to a specified variable, then the pointer does not change.
A queue is a linear table that allows insertion at one end (tail of queue) and deletion at the other end (head of queue). The Rear pointer points to the end of the queue and the front pointer points to the head of the queue.
A queue is a linear table of First-In, First-Out (FIFO) or Last In, Last Out (LILO).
Queue operations include (1) enqueue: insert an element from the tail of the queue; and (2) dequeue: remove an element from the head of the queue.
Circular queue:s=0 means queue empty, s=1 and front=rear means queue full
1.5 linear linked list
Each node in the data structure corresponds to a storage unit, which is called a storage node.
A node consists of two parts:(1) a data field for storing data element values; and (2) a pointer field for storing pointers to the previous or subsequent node.
In the chain storage structure, the storage space of the storage data structure may not be continuous, the storage order of each data node may not be consistent with the logical relationship between the data elements, and the logical relationship between the data elements is determined by the pointer field.
Chain storage can be used to represent linear structures or nonlinear structures.
Linear linked list, HEAD is called the head pointer, HEAD=NULL(or 0) is called an empty list, if it is two pointers: the left pointer (Llink) points to the predecessor node, and the right pointer (Rlink) points to the successor node.
Linear linked list of basic operations: find, insert, delete.
At this point, I believe that everyone has a deeper understanding of "what are the basic knowledge of C language", so you may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.