`
leonzhx
  • 浏览: 785936 次
  • 性别: 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 ...

    Introduction to Deep Learning.pdf

    1. 深度学习简介:文档标题为“Introduction to Deep Learning”,这表明文档旨在向读者介绍深度学习这一领域。深度学习是机器学习的一个子领域,它基于人工神经网络的概念,通过构建多层次的网络来模拟人脑的工作...

    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 Optimization 中文版

    《优化理论:An Introduction to Optimization 中文版》是一本经典书籍,主要探讨了数学优化领域的核心概念和技术。本书分为两大部分,第一部分为数学回顾,介绍了必要的数学基础知识;第二部分深入讨论无约束优化...

    An Introduction to Statistical Learning

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

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

    而《Introduction to Linear Optimization.pdf》这部教材,作为运筹学中线性优化的经典教材,详细地介绍了线性优化的理论基础、算法和应用实例。 知识点一:线性优化的定义与模型 线性优化,又称线性规划,是数学...

Global site tag (gtag.js) - Google Analytics