Giter Site home page Giter Site logo

oop3assignment1's Introduction

Team 4 : Assignment 1

Hello! We are Team 4.

Following the given instructions, we have developed this project, which is currently running smoothly.

Custom Sorting: Heap Sort

Heap sort is a comparison-based sorting technique based on a binary heap data structure. It divides its input into a sorted and an unsorted region, and it iteratively shrinks the unsorted region by extracting the largest element and moving that to the sorted region. The key improvement is the use of a heap data structure rather than a linear-time search to find the maximum.

Steps:

  1. Build a max heap (or min heap, if you're sorting in ascending order) from the input data.
  2. The largest item is stored at the root of the heap. Replace it with the last item of the heap, followed by reducing the size of the heap by one. Finally, heapify the root of the tree.
  3. Repeat step 2 while the size of the heap is not one.

Description:

Heap sort is not a stable sort, meaning the relative order of equal sort items is not preserved. However, it boasts a consistent O(n log n) time complexity, even in its worst-case scenario. This can make it faster than algorithms like QuickSort in certain situations where QuickSort degrades to O(n^2).

Testing

We use a 'test.bat' batch file to test sort.jar, and then record the output to out.txt.

oop3assignment1's People

Contributors

abo-chen avatar

Watchers

 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.