Arrays, hash tables, linked lists, queues, stacks, & trees (My repl.it playground while studying for FAANG)
Tags: algorithms, javascript, career, computerscience
Published: 2021-08-03 01:15:17

{% user cleancodestudio %}

[![Twitter Follow](https://img.shields.io/twitter/follow/cleancodestudio.svg?style=social)](https://twitter.com/cleancodestudio) 


>
> Did you know I have a newsletter? 📬
>
> If you want to get notified when I publish new blog posts or
> make major project announcements, head over to 
> https://cleancodestudio.paperform.co/
>

---

{% replit @zhorton34/Data-Structures %}


**Note:** This repl.it project was my sandbox/playground while I was studying for my FAANG interviews - not all data-structures and/or algorithms are guaranteed to work. This repl.it project is like my personal notes/journal - not professionally backed or tested. I could be wrong in my implementation and some parts may not work all together. 
![Repl.it folder structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqdbgz3643atbg6k8bzj.png)
Feel free to comment below if you want clarification on the credibility of some of the data structures shown in my practice repo.
 

--- 

This is the **index.js** page shown in the repl.it linked above. Uncomment the require statement that loads the file to the given data structure you want to tinker with then press the play/run button to re-execute the code. 




```js
/**----------------------------------------------
 | Arrays
 *-----------------------------------------------
 |
 |   . Pros
 |     - Ordered
 |     - Fast lookups
 |     - Fast push & pop
 |
 |   . Cons
 |     - Slow iserts
 |     - Slow deletes
 |     - Fixed size (when using static arrays)
 |
 |   . Operations
 |     - append O(1)*
 |       -> may be O(n) 
 |       -> if allocated memory block needs more space
 |     - lookup O(1)
 |     - insert O(n)
 |     - delete O(n)
 |
 */

// require('./arrays/introduction.js')
// require('./arrays/static-vs-dynamic.js')
// require('./arrays/implementation.js')
// require('./arrays/strings-and-arrays.js')
// require('./arrays/merge-sorted-arrays.js')


/**----------------------------------------------
 | Hash Tables
 *-----------------------------------------------
 |
 |   . Pros
 |     - Fast lookups*
 |     - Fast inserts
 |     - Flexible keys
 |
 |   . Cons
 |     - Unordered
 |     - Slow key iteration
 |
 |   . Operations
 |     - insert O(1)
 |     - lookup O(1)
 |     - delete O(1)
 |     - search O(1)
 |
 */


// require('./hash-tables/introduction.js')
// require('./hash-tables/collisions.js')
// require('./hash-tables/implementation.js')
// require('./hash-tables/first-recurring-character.js')


/**----------------------------------------------
 | Linked List
 *-----------------------------------------------
 |
 |   . Pros
 |     - Ordered
 |     - Flexible size
 |     - Fast deletion
 |     - Fast insertion
 |
 |   . Cons
 |     - Slow lookup
 |     - More memory
 |
 |   . Operations
 |     - prepend O(1)
 |     - append O(1)
 |     - lookup O(n)
 |     - insert O(n)
 |     - delete O(n)
 |
 */

// require('./linked-lists/introduction.js')
// require('./linked-lists/pointer.js')
// require('./linked-lists/implementation.js')
// require('./linked-lists/reverse.js')


// require('./stacks/introduction.js')
// require('./stacks/implementation.js')

// require('./queues/introduction.js')
// require('./queues/implementation.js')
// require('./queues/queues-using-stacks.js')



/**----------------------------------------------
 | Trees
 *-----------------------------------------------
 |
 |
 */
// require('./trees/introduction.js')
// require('./trees/implementation.js')
// require('./trees/binary-search-tree-implementation.js')
require('./linked-lists/implementation.js')
```



[All of my Data Structures and Algorithms Notes for FAANG Interview Preparation](https://www.cleancode.studio/notes/faang-interview-notes)



[Clean Code](https://cleancode.studio/clean-code)
[Clean Code Studio](https://cleancode.studio)
[Refactoring Code](https://cleancode.studio/refactoring)
[Computer Science Algorithms](https://cleancode.studio/algorithms)
[Data Structures - JavaScript](https://cleancode.studio/data-structures)
[Design Principles](https://cleancode.studio/design-principles)

---

{% user cleancodestudio %}

>
> Did you know I have a newsletter? 📬
>
> If you want to get notified when I publish new blog posts or
> make major project announcements, head directly below and do 
> your thing!
>

{% codepen https://codepen.io/zhorton34/pen/BaRPYdB %}