`
leonzhx
  • 浏览: 796701 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
阅读更多

1. Why Study Algorithms

  a)  important for all other branches of computer science
  b)  plays a key role in modern technological innovation
  c)  provides novel “lens” on processes outside of computer science and technology
  d)  challenging (i.e., good for the brain!)
  e)  fun

 

2. A recursive algorithm for multiplication of two n-digits numbers

  x = a* 10^n/2 + b ; y=c*10^n/2 + d

  x*y = ac*10^n + (bc + ad) * 10^1/2 + bd

Idea: recusively compute ac, bc, ad, bd until one digit multiplication.

 

3. Karatsuba Multiplication

 x*y = ac*10^n + (bc + ad) * 10^1/2 + bd

(bc+ad) = (a+b) * (c+d) - ac - bd

 

Idea: only need to recursively compute ac, bd, (a+b) * (c+d) -- 3 recursive multiplications

 

4. Course Topics

  a)  Vocabulary for design and analysis of algorithms
  b)  Divide and conquer algorithm design paradigm
  c)  Randomization in algorithm design
  d)  Primitives for reasoning about graphs
  e)  Use and implementation of data structures

5. References:

  a)  Kleinberg/Tardos, Algorithm Design, 2005.
  b)  Dasgupta/Papadimitriou/Vazirani, Algorithms, 2006.
  c)  Cormen/Leiserson/Rivest/Stein, Introduction to Algorithms, 2009 (3rd edition).
  d)  Mehlhorn/Sanders, Data Structures and Algorithms: The Basic Toolbox, 2008.

6. Merge Sort:

  a) recursively sort 1st half of the input array

  b) recursively sort 2rd half of the input array

  c)  merge two sorted sublists into one

 

7. Pseudocode for Merge:

 

C = output [length = n]
A = 1st sorted array [n/2]
B = 2nd sorted array [n/2]

i = 1
j = 1

for k = 1 to n
    if A(i) < B(j)
        C(k) = A(i)
        i++
    else [B(j) < A(i)]
        C(k) = B(j)
        j++
end

 

8. Running Time of Merge for m elements : 4m (compare, assingment, increment of i/j, increment of k) + 2 (init of i&j ) <= 6m ( m>=1)

 

9. Running Time of Merge Sort :

  For every input arry of n numbers, Merge Sort produces a sorted output array and uses at most 6nlogn+6n operations. ( logn + 1 level of recursion tree and each level take 6n )

 

10. Guiding Principle:

  a) worst-case analysis over running time

  b) won't play much attention to constant factors, lower-order terms

  c) asymptotic analysis: focus on running time fro large input size n

 

11. fast algorithm = worst-case running time grows slowly with input size. Usually want as close to linear(O(n)) as possible.

 

分享到:
评论

相关推荐

    Introduction to Linear Algebra

    从网上看到Introduction to Linear Algebra这本书(Algebra_Gilbert Strang),介绍的清晰易懂且很到位。就搜集了一些。包括第三版、第四版和讲课笔记。听说第三版比较经典,暂时只上传了第三版和笔记。虽然是英文的...

    Introduction to Computing Systems

    Introduction to Computing Systems from Bits and Gates to C and Beyond.pdf 2nd Edition [English] 本书是计算机系统概论的英文原版,计算机科学的经典基础教材。全书以自底向上方法帮助学生理解计算机系统的原理...

    Hack Audio:An Introduction to Computer Programming and DSP in Matlab.rar

    Hack Audio:An Introduction to Computer Programming and Digital Signal Processing in Matlab 2019 Hack Audio:An Introduction to Computer Programming and DSP in Matlab.part1.rar (15 MB, 下载次数: 237...

    Introduction to Space-Time wireless Communications

    This book is an accessible introduction to the theory of space-time wireless communications. The authors discuss the basics of space-time propagation, space-time channels, channel capacity, spatial ...

    An_introduction_to_computational_fluid_dynamics.pdf

    Basic introduction to computational fluid dynamics, using the finite volume method. Table of Contents Preface Acknowledgements 1 Introduction 1 2 Conservation Laws of Fluid Motion and ...

    An Introduction to Manifolds, 2nd edition by Loring W. Tu.

    标题《An Introduction to Manifolds, 2nd edition by Loring W. Tu》和描述《An Introduction to Manifolds, by Loring W. Tu》共同指向了数学领域中微分几何的核心概念——流形。在现代数学及物理学中,流形是一个...

    An Introduction to Statistics with Python(Springer,2016)

    This textbook provides an introduction to the free software Python and its use for statistical data analysis. It covers common statistical tests for continuous, discrete and categorical data, as well ...

    An Introduction to Statistical Learning

    1. 书籍标题《An Introduction to Statistical Learning》(统计学习导论)是《The Element of Statistical Learning》(统计学习基础)一书的入门版本,这意味着它为读者提供了该领域的基础知识和初步理解。...

    Introduction to Modern Cryptography

    首先,“Introduction to Modern Cryptography”是该文件的标题,其对应的中文是“现代密码学介绍”,表明这是一本关于现代密码学基础和原理的书籍。作者是任伟,从2010年版本来看,本书无疑是一本深入浅出介绍现代...

    A Classical Introduction To Modern Number Theory

    《A Classical Introduction to Modern Number Theory》(《现代数论的经典入门》)是由已故的肯尼斯·爱尔兰(Kenneth Ireland)和迈克尔·罗森(Michael Rosen)共同著作的数论入门书籍。数论,作为数学的一个分支...

    Introduction to Robotics 机器人学导论 第三版 原书 英文版

    本书系统讲解了机器人学的理论知识,主要内容包括:机器人操作臂的几何性质、引起操作臂运动的力和力矩、与操作臂... 本资源是《机器人学导论》Introduction to robotics mechanics and control 原书第三版 英文版。

    Introduction to Lens Design

    Introduction to Lens Design

    Introduction to Algorithms Third Edition

    This book provides a comprehensive introduction to the modern study of computer algorithms. It presents many algorithms and covers them in considerable depth, yet makes their design and analysis ...

    Introduction to Java programming 8th

    become proficient Java programmers A brief version Introduction to Java Programming Brief Version Eighth Edition is available for a first course on programming commonly known as CS1 The brief version ...

    An Introduction to Data Science

    An Introduction to Data Science by Jeffrey S. Saltz and Jeffrey M. Stanton is an easy-to-read, gentle introduction for people with a wide range of backgrounds into the world of data science. Needing ...

    Density_Functional_Theory_A_Practical_Introduction

    Density Functional Theory: A Practical Introduction offers a concise, easy-to-follow introduction to the key concepts and practical applications of DFT, focusing on plane-wave DFT. The authors have ...

    中文翻译Introduction to Linear Algebra, 5th Edition 2.5节

    中文翻译Introduction to Linear Algebra, 5th Edition 2.5节1 若方阵 A 有逆,则既有 A−1A = I 又有 AA−1 = I。 2 检验可逆性的算法是消元法:A 必须有 n 个(非零)主元。3 可逆性的代数检验是 A 的行列式:det ...

    Reinforcement Learning:An Introduction.pdf

    An Introduction Second edition, in progress November 5, 2017 Richard S. Sutton and Andrew G. Barto The text is now complete, except possibly for one more case study to be added to Chapter 16. The ...

Global site tag (gtag.js) - Google Analytics