算法vs Pseudocode
算法只是解决问题的解决方案。算法将问题作为一组定义的步骤或指令提供的解决方案。伪代码是描述算法的一般方法。伪代码不使用特定编程语言的语法,因此不能在计算机上执行。但是它与编程语言的结构非常相似,并且包含大致相同的细节。
算法
一个算法给出了解决一个特定问题lem as a well defined set of steps. A recipe in a cookbook is a good example of an algorithm. When a computer is used for solving a particular problem, the steps to the solution should be communicated to the computer. This makes the study of algorithms a very important part in computer science. An algorithm is executed in a computer by combining lot of elementary operations such as additions and subtractions to perform more complex mathematical operations. But translating the idea of the algorithm in to computer code is not straight forward. Specially, converting an algorithm in to a low level language such as assembly language could be very tedious than using a high level language such as C or Java. When designing an algorithm, it is important to do an analysis on the resources (such as time and storage) required by the algorithm. Notations such as big O notation are used for performing time and storage analysis on algorithms. Algorithms can be expressed using natural languages, pseudocode, flowcharts, etc.
伪代码
伪代码是可用于表示算法的方法之一。它不是用编程语言使用的特定语法编写的,因此不能在计算机中执行。有很多用于编写伪动物的格式,其中大多数从流行的编程语言(例如C,LISP,Fortran等)借用了一些结构。此外,在呈现不重要的细节时,也使用了自然语言。大多数算法都是使用伪代码提出的,因为可以使用熟悉不同编程语言的程序员阅读和理解它们。诸如Pascal之类的某些语言具有与假码相似的语法,从而使从伪代码转换为相应的程序代码的转换更加容易。伪代码允许包含控制结构,例如whir,如果是else,重复,直至,for和case,它们都以许多高级语言存在。
算法和伪代码之间有什么区别?
算法是一个定义明确的步骤序列,为给定问题提供解决方案,而伪代码是可用于表示算法的方法之一。虽然算法可以用自然语言编写,但伪代码以与高级编程语言结构密切相关的格式编写。但是伪代码不使用特定的编程语言语法,因此可以由熟悉不同编程语言的程序员理解。此外,将伪代码中提出的算法转换为编程代码要比转换以自然语言编写的算法要容易得多。
Poojitha Pallesays
very good description
Poojitha Palle
noctis lucis Ishutinsays
this is really help me… thanks a lot.. XD
Sukusays
我的理解的最佳答案
Bijayasays
描述更多PLZ
Mequanint Mollasays
ThiS is brief explain,I anderstand what I want,
Sai Pranav Raosays
优秀的保持
查尔斯says
描述有所帮助