jiyuhan / common-algorithms-implementation

This is a repo that I do to let me remember how to implement algorithms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

common-algorithms-implementation

This is a repo that I do to let me remember how to implement algorithms. I will be using Java first, then C++ or even C, Javascript at last possibly.

Important Algorithms

Linked List

Linked list is an easy one to start off of. Especially when using Java, there's no pointers or anything else to worry about. I don't know how I would use JS to implement since it's harder to implement class or struct, but I will get there eventually.

Find, Insertion, and Deletion

Be careful about Deletion, remember how Linus Torvalds mentioned the "correct" way to delete a node in C++, try to do that for insertion as well.

Trees

Fairly similar to Linked List, but a little bit trickier. Implement the same find(), insert(), and delete(). Sorting is more complicated since it's a tree.

Sorting

For sorting, I will implement all the common/popular sorting algorithms out there.
Things like: insertion sort, selection sort, merge sort, heapsort, quicksort, bubble sort, bucket sort, and radix sort.
Remember to have their complexity calculated.

Other Interesting Algorithms

Finding Substring (Implement contains() function)

I tried to implement this once, but didn't turn out very well. Welp, time to learn. (Rabin-Karp seems like a good way to do this.)

bool isPrime()

This seems not too bad but kind of useful.


I will add more to this list once I can think of more.

About

This is a repo that I do to let me remember how to implement algorithms.