TAILIEUCHUNG - Lecture Algorithms and data structures: Chapter 20 - Pseudo Code & Flow Charts

The preceding chapter introduces the idea of a perfect tree. Complete trees and perfect trees are closely related, yet quite distinct. In this chapter, introducing complete binary trees: Background, definitions, examples, logarithmic height, array storage. | Review 1 Algorithm Analysis Problem Solving Space Complexity Time Complexity Classifying Functions by Their Asymptotic Growth Pseudo Code and Flow Charts 2 Pseudo Code Basic elements of Pseudo code Basic operations of Pseudo code Flow Chart Symbols used in flow charts Examples Pseudo Code and Flow Charts There are two commonly used tools to help to document program logic (the algorithm). These are Flowcharts Pseudocode. Generally, flowcharts work well for small problems but Pseudocode is used for larger problems. 3 Pseudo-Code Pseudo-Code is simply a numbered list of instructions to perform some task. 4 Writing Pseudo Code Number each instruction This is to enforce the notion of an ordered sequence of operations Furthermore we introduce a dot notation (. come after 3 but before 4) to number subordinate operations for conditional and iterative operations Each instruction should be unambiguous and effective. Completeness. Nothing is left out. 5 5 Pseudo-code Statements are written in simple English without regard to the final programming language. Each instruction is written on a separate line. The pseudo-code is the program-like statements written for human readers, not for computers. Thus, the pseudo-code should be readable by anyone who has done a little programming. Implementation is to translate the pseudo-code into programs/software, such as “C++” language programs. 6 6 Basic Elements of Pseudo-code A Variable Having name and value There are two operations performed on a variable Assignment Operation is the one in which we associate a value to a variable. The other operation is the one in which at any given time we intend to retrieve the value previously assigned to that variable (Read Operation) 7 Basic Elements of Pseudo-code Assignment Operation This operation associates a value to a variable. While writing Pseudo-code you may follow your own syntax. Some of the possible syntaxes are: Assign 3 to x Set x equal to 3 x=3 8 Basic Operations of .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.