Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgashok/sortunix
demonstrate sort in Unix
https://github.com/kgashok/sortunix
demonstration sorting unix
Last synced: about 2 months ago
JSON representation
demonstrate sort in Unix
- Host: GitHub
- URL: https://github.com/kgashok/sortunix
- Owner: kgashok
- Created: 2020-02-24T10:45:07.000Z (almost 5 years ago)
- Default Branch: replit-readme
- Last Pushed: 2021-05-10T05:58:48.000Z (over 3 years ago)
- Last Synced: 2024-10-23T07:23:07.354Z (3 months ago)
- Topics: demonstration, sorting, unix
- Language: HTML
- Size: 401 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sort Unix
[![Run on Repl.it](https://repl.it/badge/github/kgashok/sortUnix)](https://repl.it/github/kgashok/sortUnix)Click the above `"run on repl.it"` gray button to launch your own fork on repl.it
## What to do?
Once you have successfully forked your own copy of the github repo on ```repl.it```, do the following inside repl.it:
1. Press the green "run" button above
2. Observe what happens on the console on the right.## Part 1 - Objectives
"_Begin with the end in mind_"1. Observe how sort command works in Unix
2. Read strings from text file (names.txt)
3. Sort the strings and show the output
4. Add "india" to the names.txt file
5. Sort the strings again and show the output
6. Add your name to the file names.txt
7. Press the "run" button again - see where your name appears in the listor listen to http://j.mp/unixSortDemo
## Files description
- `main.sh` - which executes every time you press the green "run" button
- `names.txt` - text file to edit your name into## Part 2 - Objectives
"_Going from Known to Unknown_"1. Make sure you know the pseudo code (aka Python) for the Selection Sort algorithm
> ![algo](https://i.imgur.com/iQbEbrf.jpg)
> - practice the http://j.mp/selectionSortCC - Python exercise on CloudCoder2. Review the file `selectsort.md`
3. Come prepared to share and write the algorithm on the board
4. Review the C code for `selectsort.c` to perform live!## Part 3 - Objectives
"_Pre-requisite knowledge is critical_"0. If a character array is of length 15, what is the range of the valid index values?
- 0 to 15
- 1 to 15
- 1 to 14
- 0 to 14
- None of the above
1. Make sure you know how `strcmp` function works. Visit https://www.geeksforgeeks.org/strcmp-in-c-cpp/
2. How do you swap two numbers without using a third variable?
3. What is code snippet to swap two character array variables in C?## Part 4 - Challenge yourself!
"_I find that I don’t understand things unless I try to program them._"
— Donald E. Knuth, The Art of Computer Programming, Volume 4Listen to http://j.mp/unixSortKey video series.
- Or if you prefer images http://j.mp/selectSortCWrite code along the same steps on http://j.mp/selectionSortC and pass all the test cases
- If you practice well, and compete in the liveCoding session, and finish all the test cases < 6 min, you can win upto Rs 1,000 worth of gift prizes
- Be among the **First 3** to complete to maximize your prize money## Part 5 - The Pointer Version!
"_Learning algorithms without implementing them is like learning surgery based solely on reading an anatomy book._" - Alexander S. Kulikov and Pavel PevznerAnd if you can complete the pointer version of the code within 6 min, and answer questions on the code, you can win upto Rs 3,000 worth of gift prizes
- To really _**grok**_ the algorithm in the pointer version, launch the visualizer and single step through it - http://bit.ly/visualSort
- Be among the **Best 3** to complete the challenge to maximize your prize money## Part 6 - Advanced Challenge
_"Go where no man or woman has gone before!"_- A more efficient SelectionSort using MinMax values - https://www.geeksforgeeks.org/sorting-algorithm-slightly-improves-selection-sort/
![code](https://i.imgur.com/o7K1gYB.jpg)
# ----
## Faculty Notes
- Selection sort as a series of photos http://j.mp/selectSortC
- video descriptions
- Using cards to simulate selection sort http://j.mp/selectionSortVideo
- Selection visualization on PythonAnywhere http://bit.ly/selectionVideo2- C visualizer for SelectionSort http://bit.ly/visualSort and http://bit.ly/visualSortVideo
- Space repetition on Memcode http://bit.ly/memCodeC