`
leonzhx
  • 浏览: 774696 次
  • 性别: 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 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 Communication Electronic Warfare Systems.pdf

    1.1 Introduction 1 1.2 Information Warfare 1 1.3 Electronic Warfare 3 1.3.1 Electronic Support 3 1.3.2 Electronic Attack 4 1.3.3 Electronic Protect 4 1.4 Electronic Support 5 1.4.1 Low Probability of ...

    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 ...

    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 Numerical Analysis

    An Introduction to Numerical Analysis Endre S¨uli and David F. Mayers University of Oxford Cambridge University Press Contents 1 Solution of equations by iteration 2 Solution of systems of linear ...

    An introduction to copulas

    【书名】 An Introduction to Copulas 【作者】Nelsen, Roger B. 【出版社】Springer【版本】2nd ed【出版日期】2006【文件格式】PDF【文件大小】2.28 MB;【页数】250 Pages;【ISBN出版号】ISBN: 978-0-387-28659-4;...

    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 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 ...

    Introduction to Wireless and Mobile Systems

    Introduction to Wireless and Mobile Systems

    An Introduction to Fluid Dynamics (Batchelor)

    This book gives an excellent introduction to fluid dynamics First published in 1967, Professor Batchelor's classic work is still one of the foremost texts on fluid dynamics. His careful presentation ...

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

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

    A Mathematical Introduction to Robotic Manipulation.pdf

    李泽湘 运动学 动力学求解This chapter presents an introduction to the dynamics and control of robot manipulators. We derive the equations of motion for a general open-chain manipulator and, using the ...

    Introduction to Deep Learning.pdf

    Introduction to Deep Learning From Logical Calculus to Artificial Intelligence

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

    中文翻译Introduction to Linear Algebra, 5th Edition 7.4节,仅用于交流学习! 1 一个典型的方阵 A = U ΣV T 分解为 (旋转)(拉伸)(旋转)。 2 几何展示了 A 如何将圆上的向量变换为椭圆上的向量 Ax。 3 A 的范数是...

    Introduction to Linear Algebra

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

    Introduction to MIMO Communications

    MIMO的2014年最新英文原版书籍,Introduction to MIMO Communications

    Introduction To Computing Using Python

    Perkovic's Introduction to Programming Using Python provides an imperative-first introduction to Python focusing on computer applications and the process of developing them. The text helps develop ...

Global site tag (gtag.js) - Google Analytics