《[郝斌老师]自学数据结构大纲笔记([hao bin teacher] self-study data structure outline notes)》由会员分享,可在线阅读,更多相关《[郝斌老师]自学数据结构大纲笔记([hao bin teacher] self-study data structure outline notes)(32页珍藏版)》请在金锄头文库上搜索。
1、郝斌老师自学数据结构大纲笔记(Hao bin teacher self-study data structure outline notes)Data structure overview (teaching materials selected Yan Yumin and Wu Weimin, the book program is pseudo algorithmThe concrete procedure is one where, West, Daniel, onlyProgram. There is a book written by Huang Guoyu of Taiwan hi
2、mselfOnly thinking, the program is another co written by QinghuaUnfortunately, a lot of wrongAfter you have learned the data structure, you will have a deeper understanding of the process functionsDefinitionHow do we put a large number of complex problems in reality into specific data types?How do y
3、ou store data? And specific storage structures (personal relationships)Save to the main memory (memory), and on this basis, to implement a function(such as searching for an element, deleting an element, sorting all elements)And the corresponding operation, the corresponding operation is also called
4、algorithm. For example, in class15 people, the amount of information may be an array on it, but if 10000,What should I do? Memory may not have so many contiguous spaces, so well use the linked list,You see, that is to do with storage. Another example is the information storage of the personnel manag
5、ement system,Because of the existence of upper and lower levels, arrays and linked lists are powerless,At this time we use trees, and then, for example, what we do is a traffic map. The station and the station must be connectedTheres nothing more we can do about storage, so weve got the map again. c
6、hartThat is, each node can communicate with other nodes. So when we have to solveThe first thing to solve is how to convert these problems into data and save them firstInto our main memory.)Data structure = individual + individual relationAlgorithm = the operation of storing dataalgorithmMethods and
7、 steps of problem solvingStandard for measuring algorithms1, time complexityThe number of times a program will execute, not the time it takes to execute it.2, space complexityThe maximum memory occupied by the algorithm during execution3, the degree of difficulty (mainly in terms of application valu
8、e)4, robustness (not someone else to an illegal input will hang up)Status of data structureData structure is the core of software coursesProgram = data storage + data operations + language that can be executed by the computer (already available)After learning the data structure and trying to impleme
9、nt it in one language, you must have pointers, data structures, JavaOn the version, nonsense, stale, because we talk about the list, is through the pointer chain together. such asIn Java, A, AA = new, A (); essentially, AA is an address.)Preliminary knowledgePointerThe importance of pointers: (memor
10、y can be accessed directly by CPU, the hard disk does not workIt mainly depends on address bus, data bus and control bus.)Pointers are the soul of the C languageDefinitionaddressThe address is the memory cell numberA nonnegative integer starting at 0Range: 0-FFFFFFFF0-4G-1 (address line is 32 bit, j
11、ust 2 of control 32)Pointer:A pointer is an address, or a pointerA pointer variable is a variable that holds the address of memory cellsThe pointer is the essence of a non negative integer operation Limited (not only reduce operations.)Sort:1, basic types of pointers2, the relationship between point
12、ers and arraysStructure (implemented in class in C+)Why does the structure appear?In order to represent some complex data, an ordinary base type variable can not meet the requirementsWhat is called a structure?Structure is a composite data type defined by the user according to the actual needsHow to
13、 use a structureTwo ways:Struct, Student, St = 1000, Zhangsan, 20Struct Student * PST = &st;OneSt.sidTwoPst-sidPST refers to the member of the SID in the struct variableMatters needing attention:A structure variable cannot but can be assigned add, subtract, multiply and divide.Ordinary structural va
14、riables and structural pointer variables are used as function arguments(viruses are memory that is accessed by those programs that are running. Locally specified in JavaVariables must be initialized because these variables are garbage values at first, but attributes are not requiredInitialized becau
15、se it has been initialized to 0 by defaultDynamic memory allocation and release (dynamic allocation of memory must be manually released, or else cause memoryLeak out(A, AA = new, A (); in fact, A, *p = (A *) malloc (sizeof (A) JavaModule 1: linear structure wear all the nodes in a straight lineContinuous storage array1. What is called an array?The elements are the same type and the size is equal (array arguments are passed as long as the first add