Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lab-pedja/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Created by Vinicio Vladimir Sanchez Trejo

**/node_modules/*
**/vendor/*
**/*.min.js
**/coverage/*
**/build/*
41 changes: 41 additions & 0 deletions lab-pedja/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Created by Vinicio Vladimir Sanchez Trejo, Izzy Baer

{
"env": {
"browser": true,
"node": true,
"commonjs": true,
"jest": true,
"es6": true
},
"globals": {
"err": true,
"req": true,
"res": true,
"next": true,
"__API_URI__": false,
"__TITLE__": false,
"__DEBUG__": false
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"module": true,
"jsx": true
}
},
"rules": {
"no-console": "off",
"no-unused-vars": "off",
"indent": [ "error", 2, { "SwitchCase": 1 } ],
"react/prop-types": [0],
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
"space-infix-ops": ["error", {"int32Hint": false}],
"comma-dangle": ["error", "always-multiline"],
"semi": [ "error", "always" ]
},
"plugins": ["react"]
}
159 changes: 159 additions & 0 deletions lab-pedja/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Created by https://www.gitignore.io/api/osx,vim,node,linux,windows,visualstudiocode

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Webpack build folder
build/

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# mongodb db folder
db

# multer temp folder
temp


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/osx,vim,node,linux,windows,visualstudiocode

.vscode/
40 changes: 40 additions & 0 deletions lab-pedja/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
![cf](https://i.imgur.com/7v5ASc8.png) Sorting Algorithms - radix and heap sort
======

* Purpose of this lab is to practice implementation of radix and heap sort algorithm.


## Code Style
* Javascript ES6 and Jest for testing


## Tech / framework used

* [npm package jest](http://facebook.github.io/jest/) used for TDD
* [npm package eslint](https://www.npmjs.com/package/eslint) used as a JS linter


## Installation and How To Use

* Fork || clone this repo to you computer.

* Run `npm install`

* To run tests run `npm test` command.


## Heap sort

> Heap sort is a **comparison** based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for remaining integers. These are the heap sort steps:

1. Build a max heap from the input data and removing the data from the input array.
2. At this point, the largest item is stored at the root of the heap. `extractMaximum` value that is on the root node and repopulate input array with that element.
3. Repeat above steps while size of heap is greater than 1.

## Radix sort

> Radix sort is a **non-comparative** integer sorting algorithm that sorts data with integer keys by grouping keys by the individual digits which share the same significant position and value. Each key is first figuratively dropped into one level of buckets corresponding to the value of the rightmost digit. This process is repeats with the next neighbouring more significant digit until there are no more digits to process.


## Licence
MIT © Pedja Josifovic
Loading