Coder Social home page Coder Social logo

homework-1's Introduction

Homework 1

  1. Prove that each of the following sorting algorithms is stable or show that it is unstable by giving a counter example; moreover, determine whether it is in place: bubble sort, insertion sort, quick sort, merge sort and heap-sort.
    • 第十四組
  2. Given a positive integer n, design an algorithm for computing floor(sqrt(n)).
    • 第十六組
  3. How to implement merge-sort such that the extra space used is about n/2 where n is the number of input elements?
    • 第十三組
  4. Given two sorted arrays x[1..m] and y[1..n], design an algorithm to compute min_i,j|x[i]-y[i]|.
    • 第九組
  5. Solve the recurrence T(n)=2T(n/2)+n-1 where n=2^k is assumed; assume that T(n) is constant if n<=2.
    • 第一組
  6. Given a sorted array A[1..n] of n distinct integers, you want to find out the index i for which A[i]=i if it exists. Please design a Divide-and-Conquer algorithm that runs in time O(log(n)). (Analyze your algorithm and show it is correct.)
    • 第三組
  7. Analyze best-case, average-case, and worst-case performance of the following pseudocode which describes a sorting algorithm. Append your analyzing process or reasons.
    • 第七組
i = 2
while i <= size
    if i == 1 or array[i] >= array[i - 1]
        i += 1
    else
        swap array[i], array[i - 1]
        i -= 1

homework-1's People

Contributors

c910335 avatar chuanchan1116 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.