TAILIEUCHUNG - lecture 6 2012

A computer is a general purpose device that can be programmed to carry out a finite set of arithmetic or logical operations. Since a sequence of operations can be readily changed, the computer can solve more than one kind of problem. | Lecture Notes for CS120 An Introduction to Computing1 Subhashis Banerjee S. Arun-Kumar Department of Computer Science and Engineering Indian Institute of Technology New Delhi 110016 email suban sak @ August 2 2003 1Copyright 1997-2003 Subhashis Banerjee and S. Arun-Kumar. All Rights Reserved. These notes may be used in an academic course with the prior consent of the authors. 2 Contents I Models of computation 5 1 Introduction 7 2 Mathematical preliminaries 9 Sets. 9 Relations and Functions. 11 Principle of Mathematical Induction. 11 3 A functional model of computation 17 The primitive expressions. 18 Substitution of functions. 20 Substitution using let. 21 Definition of functions using conditionals. 23 Functions as inductively defined computational processes . 24 Recursive processes. 26 Analysis of correctness and efficiency. 28 Correctness. 28 Efficiency . 28 Efficiency Why and How . 29 In the long run Asymptotic analysis and Orders of growth . 30 More examples of recursive algorithms. 31 Scope rules. 41 Tail-recursion and iterative processes. 43 Correctness of an iterative process. 45 More examples of iterative processes. 46 4 The Imperative model of computation 53 The primitives for the imperative model . 53 Variables and the assignment instruction . 54 Assertions . 56 The if then else instruction. 58 The while do instruction. 61

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.