DEV Community

Clean Code Studio
Clean Code Studio

Posted on • Updated on

Arrays, hash tables, linked lists, queues, stacks, & trees (My repl.it playground while studying for FAANG)

Twitter Follow

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/


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
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.

/**----------------------------------------------
 | 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')
Enter fullscreen mode Exit fullscreen mode

All of my Data Structures and Algorithms Notes for FAANG Interview Preparation

Clean Code
Clean Code Studio
Refactoring Code
Computer Science Algorithms
Data Structures - JavaScript
Design Principles


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!

Top comments (1)

Collapse
 
cleancodestudio profile image
Clean Code Studio