[Recommended] Software Foundation and Hardware Foundation
OS basic concept part. Awareness of OS 1. External: Model: OS itself is a hierarchy model. Work up in the computer. Level: Hardware, hardware abstraction, OS kernel, OS external program, application software, etc. The hierarchical model knows from two aspects: OS in the hierarchy model of the computer; the OS itself is also hierarchical. The OS level is seen from the note. Type (Classification): Batch, minute, current affairs, single users, multiple users, stand-alone networks, etc. Function: Definition: 1 Resource Management, 2 Process Angle: Arrange your computer workflow, 3 to facilitate users. Internal composition: process, storage, device, file, disk management, etc. It can also be seen as a process store, two subsystems of the device file. Modern OS Characteristics: Dynamics, etc. (not directly examined). 2. Interior: Subsystem: Process Control: Process Processor File Management: Device File 3. What is the characteristics of typical OS: Unix, Linux, NT? Why? Corresponding design ideas: Why is NT multi-user characteristics?
General design ideas (design procedures for large modules of OS) a. Design model (hierarchy, object-oriented), for example: a given condition, design a management module. B. Module design one. Process Management Module: (Understanding and Control of Process) The meaning, condition, and sequential, parallelism between the parallelism: give a given condition, can you implement concurrency (guarantee reading write)? If you can't you? Can you go concurrently? Can you? The characteristics of the process, the state: the conversion between the individual states in a particular OS design. Such as: Linux process status conversion process. Process control, primitive, operational status: the meaning of primitive. Operation status: 1 core state: which process is running at the core state, in what circumstances there is a conversion between them? Pay attention to interrupts, system calls. Enter the core state by interruption. Interrupt processing process. If the system call is given under NT, the function name is given, and the running process in the OS is asked, in the process, the key to the key to do: Parameter check, type match, and the number of ginseng, if The number of arresters exceeds the number of medals, how to deal with? Refer to Chapter 10 OS interface. 2 User state: Which processes are running in a user state. The characteristics of threads, comparison with the process: process definitions and thread definition thread benefits thread disadvantages. Note: Answers for comparison: Definition each advantage respective shortcomings. 1. Process communication: (no programming questions) The meaning of critical regions and critical resources: communication mode: low, advanced (message, shared storage, etc.) process scheduling model: divided three layers: process scheduling, intermediate scheduling, job scheduling . Which type belongs to a specific OS? In general, UNIX has no job scheduling, while others have three schedules. Common Process Scheduling Algorithm: 1 Each Algorithm: Priority Scheme, Interesting to Dynamic Priority; Unix Multi-Level Queue Feedback Turn. 2 each characteristics: good? Bad? 3 Support for implementation: If the dynamic priority needs, what data structure is required, hardware. 4 What is it in the actual OS? two. Storage Management Module (Memory Octave Cache TLB) 1. Memory (especially subregional) (1) Several typical memory allocation schemes: basic ideas; design, how to achieve dynamic partitions; features (pros and short). (2) Virtual storage ideas: (3) Request paging: Thought: Hardware support: Page table, address conversion, missing page interrupt page assignment policy: page placement algorithm: OBT, LRU, LFU, etc. Pay attention to their respective ideas; soft (data structures) hardware (storage area, register, etc.) implementation.
Example: 2. Osmount (especially continuous distribution) (1) Disk scheduling algorithm: 1 thought: 2 instance: For a particular example, what is the best disk scheduling algorithm (2) Oversessure allocation: 1 Continuous: Process, how to do, assign The situation is not good. 2 Link: Explicit, implicit meaning characteristics: ideas, probably practicing. 3 Index: Common, so I don't have to test. 3. Jitter (request paging): Will the exit space allocation do not have jitter? What are the differences in spatial distribution methods, internal and external distribution? Can jitter see a aspect? 4. Debris: Different allocation plans should consider these four problems (1) meaning: (2) Cause: Division of fragments, paginized pages, and continuous assignments of exocial distribution. (3) Solution: Compact. When is it? Paging usually not talking about compact (4) Classification: 1 Debris (memory) and horizontal (outside) 2 Debris is the space that has been assigned to the process but will not be used. 5. Instance Design: Try to use speed fast price acceptable. EG: Using Cache without disk. three. Equipment and file management modules (less current problems) 1. I / O control method, practice: The focus is interrupted. Such as: Interrupt processing procedure, the state it runs (can be in the core state). 2. Buffer: Type, Role (Buffer Speed). Note: From the design perspective. Actual OS one. They reflect the characteristics and how to reflect: such as Linux spends shorter time, why? From the perspective of the scheduling algorithm. two. Process / thread scheduled algorithm and algorithm process, data structure, characteristics. (Priority definition, how to change, standard) three. Requests the details of the page scheme: data structure, page replacement, elimination, etc. Dead lock does not test, UNIX estimates will not be examined, the partition is the focus, the possibility of test Linux and NT is relatively large. 1.1.3 1.2.5 2.1.2 2.1.3 2.3.1 2.2.1 2.4.1 2.4.2 2.4.3 3.1.1 3.1.2 3.5 4.1 4.2 5.2.2 5.2. 3 5.2.4 5.4 5.5.1 5.5.2 6.1 6.2 6.3 6.4.3 7.2.2 7.3 8.2 9.1 9.2 10.2
DS
1. The concept of data structure: The inner connection between the data. To understand the concept of three data structures: logical structure; physical structure; basic operation. For example, stacks and team logical structures are linear, but their basic operation is different, which is different data structures. 2. Classification of common data structures: linear relationship; collection relationship; one-to-many; multi-to-many (Figure); 3. What is the physical structure (there should be impressive). 4. When the algorithm is designed, use the class PASCAL, the class C, do not use C . 5. Common methods for algorithm analysis: pre-analysis; post-statistics. 6. Time / spatial complexity concept. Space is the algorithm runtime resource occupancy. Time complexity: worst, best, average. For example: Multiplexing is O (N * logn), preferably, the most is the same, the same insertion sort: preferably O (N), the worst O (N2) 7. Linear table: logical relationship, various basic operations, and the return of two ordered forms. The order of the linear table: the operation of the linear table is implemented in the sequence table. For example: 1. The position of insertion and deletion and insertion is related to the top length. 2. Insert an average complexity of an element in a table for a long N-N, the probability distribution expression of the insertion position, that is, this expression is given, and the average complexity is given. 8. Linear chain storage: Basic operations of the linked list: 2 ordered menu mergers. For example: 1. Reverse the linked list: a pointer P pointing to the last node of a series of nodes, with the next NEXT insertion into the header. 2. Tricolor question: Node red-yellow blue is arranged in the linked list and put them in the order of red and yellow blue. The request can only be searched from the head to the tail. Set the current pointer P, head pointer S, S.NEXT is Q, S, back the red node. If P is red, after inserting S. If p is yellow, insert Q. If p is the blue, it doesn't move. The p is then moved backwards, and ask for the next. Note: To understand the insertion of single-strand tables, delete what location operation. 9. Static Links (Array Representation): No restricted nodes are not limited to single-strand tables. 10. Circulatory list: If you represent queues, use it best. P point to the tail. Benefits: Used in the priority queue. 11. Bidirectional Link Picture: Only P in a single-strand list points to the current node, and cannot delete P. Because the P's pre-P is not found. And the two-way linked list can be. Pay attention to the change of pointer. 12. Stack: Take the first out. Basic operation: Take the top and put the top. Implementation on the sequence table and the list; Is it reasonable? For example: The stack sequence is 1, 2, and n, how many of the stack sequences? (Number of n nodes of the binary tree. Because the order of the tree is 1, 2,, n). 13. Stack and recursive: See I will send you the handwritten handwritten. 14. Queue: Advanced now. Link queue, cycle queue. For example: 1. Delete the i-pin from the header: Queue only queues the team and cannot be deleted directly.
To first set the first I-1 team, enter the tail; i out of the team; I 1 out of the team into the tail. 2. The queue is inverse (team head and team tail interaction): out of the stack and the stack. Note: What is the basic operation of these structures and cannot be mixed. 15. Cycle queue: team head pointer and team tail pointer. Remember team empty and full symbols. See your hand. 16. String: 1. KMP algorithm, seeking NEXT function value, etc. Time: o (n m). Among them, the pattern is matched to o (n); pre-processing is O (M), it will prove them. A brief proves to see the handwritten version. 2. Asking for two strings, the time is O (N) is not, at least O (N2). Specific proof is estimated. 17. Array: The storage location corresponds to the subscript. Special arrays (symmetrical, upper triangles, etc.). Three-tuple, sparse matrix (reverse). The application of the counting technology in the design algorithm. The cross chain is not examined. Generalized form: Basic concept, storage structure (two-fork list). Application does not test. Generalized table Recurrence Algorithm. 18. The nature of the binary tree (cooked). Storage structure: two forklon table, trigeminal list. Traverse: China, first, then. Follow the layer traversal: use the auxiliary queue. For example, how many nodes have a K layer. 19. Core bifurcation: order (in order not to test). Insertion deletion in the clue does not test. 20. The traversal of the tree and the forest: the primary root of the tree and the rear root (respectively correspond to the order of the corresponding binary tree, or order). The order and sequence of the forest (respectively correspond to the order, order of the corresponding binary tree). The tree corresponds to the binary tree. The second fork tree can be uniquely determined by the order. The order of order is not possible. Example I saw the handwritten version. The binary tree can be empty, the tree cannot be empty (the tree is a root ordered tree). twenty one. Tree and Equivalence: For example: whether an element belongs to a particular collection, you can see if this node is on this tree. Look at whether the two nodes are in a strongly connected component, see if they are on a tree. Seeking Kruscal algorithm (minimum span collection). twenty two. Hawman: prefix code. It is a two-fork tree with a weighted external path length. It is a strict two-fork tree, and there is no point. Number of nodes = 2 × Leaf node -1. Construction, encoding. Extension: Use 0, 1, 2 three into the code: the number of elements is quicker. N Elements K Bao: K-1 Except N-1. Otherwise, the increase in probability is zero. Pay attention to the best return in Section 11.6. twenty three. Counting count: Record. 1. N operators or N brackets, the number of cases of operators. 2. N 2 vertical convex polygons, his number of different triangles. 3. A1, A2,, AN, AI = 1 / -1, any of the first k AI is greater than or equal to 0, and seek different combinations. 4. See your hand. twenty four. Figure: Storage structure (for a directed figure and no map). The information stored in the neighboring table is not a vertex content but a vertex number. 25. The traversal of the figure: depth priority to the stack; breadth is preferred by means of the queue.
26. Connection of the figure: Depth priority to search once. 27. The strong linkage component (not important) of the direction map. 28. Minimum spanning tree: PRIM algorithm, Kruscal algorithm. Write algorithm to use trees and equivalents. (SEL-UNION algorithm). Their time complexity. If you use the priority queue, the time complexity is lowered. 29. Joint point, critical path: depth priority. 30. Have a loop map: topology sort. Save it with an adjacent matrix, the column of the degree is 0 is 0. Remove the node, there must be a node degree of 0, so adjust the matrix to obtain a triangular matrix. DAG map is equivalent to topology. Topology Sort Algorithm: 2 shared chain stacks, use space. If you have to reverse the order, you don't have the stack and use the queue; you can also add a stack. You can also search depth priority to find that the most deepest node will output it. 31. The shortest path: single source (with direction map, and weight> = 0 is the adaptation range of the DijisTRU algorithm). For no way, it can be seen as two direction values. Example I saw the handwritten version. Q: Can Dijistru algorithms to make a minimum spanning tree? No. Print the shortest path, time O (N2), space O (N), can be used with the Dijistru algorithm to get a collection, record the elements in front of each node, one one looks forward. 32. Two diagrams: Is a picture of the two diagrams? Time is O (n). Use equivalence: One side of the two points belong to do not use equivalents (estimated not to take too deep). 33. Partner system, border identification (to see). Useless unit collection does not test. 34. Sequential lookup time (worst, average). Ordered table lookup, two-point lookup, folding half lookup (determined the tree, the height of the tree, the average retrieval length (different situations in successful and unsuccessful)). The static tree is not examined, and the static second is excellent. Index sequence list: concept. Dynamic lookup: binary sorting tree: The order is traversed in order, order disorder. The order of the first (or post) is given, and this tree is written (since the order is the order, known). His insertion and deletion (delete is not necessarily examined). Give a tree, seek average lookup length. Find the length of the length. Balance binary tree: must be a binary sequence tree. All subtots of the tree are balanced binary trees. It is not true. To perform 4 rotations, at least 7 nodes. M-step B tree: The upper and lower limits of the number of keywords. N Keywords constitutive nodes number of nodes. B tree concept. Key tree. 35. Hardi Table: A method of resolving conflicts. Only the chain address method can solve the secondary gather. Not synonymous will not compete in the same location. Chain address method is the perfect combination of sequential structure and chain structure. 36. Find length: 1. The number of detections (including the last time is empty). 2. Keyword comparison number (excluding the last time is empty).