Algorithms

 1 concept of algotithoms:
    Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.
    We can also view an algorithm as a tool for solving a well-specified computational problem. The statement of the problem specifies in general terms the desired input/output relationship. The algorithm describes a specific computational procedure for achieving that input/output relationship.
2 What is a good algorithm? Take soring for example.
    Which algorithm is best for a given application depends on--among other factors-
    (1) The number of items to be sorted
    (2) The extent to which the items are already somewhat sorted
    (3) Possible restrictions on the item values, and the kind of storage device to be used: main memory, disks, or tapes.
3 Correctness and Incorrectness of algorithms
    An algorithm is said to be correct if, for every input instance, it halts with the correct output. We say that a correct algorithm solves the given computational problem.
    An incorret algorithm might not halt at all on some input instances. or it might halt with an answer other than the desired one.
    Contrary to what one might expect, incorrect algorithms can sometimes be useful, if their error rate can be controlled.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值