Skip to content

viniciusferreira7/data-structures-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ WIP

🧠 Algorithms Playground

A collection of algorithm implementations in TypeScript, focusing on clarity, performance, and well-known problem-solving patterns.


📚 Algorithms & Data Structures

Sorting Algorithms

  • 🔗 Bubble Sort - Simple comparison-based sorting (O(n²) time, O(1) space)
  • 🔗 Quick Sort - Efficient divide-and-conquer sorting (O(n log n) average)
  • 🔗 Merge Sort - Stable divide-and-conquer sorting for linked lists (O(n log n) time, O(log n) space)

Array & Searching Techniques

Binary Search Family

Two-Pointer Techniques

Hash Map Patterns

Sliding Window Patterns

Binary Algorithms

  • 🔗 Missing Number - Find the missing number in array containing n distinct numbers in range [0, n] (O(n) time, O(1) space)

Tree Data Structures

Binary Search Tree

  • 🔗 Binary Tree Implementation - Binary search tree with insert, search, and traversal operations
    • Insert values maintaining BST property (O(log n) average, O(n) worst case)
    • Search for values efficiently (O(log n) average, O(n) worst case)
    • In-order traversal returning sorted values (O(n) time)
  • 🔗 Build Binary Tree from Traversals - Reconstruct a binary tree from pre-order/post-order and in-order traversal sequences

Stack Data Structures

  • 🔗 Stack (Array) - Stack implementation using array with LIFO behavior (push, pop, peek, isFull, isEmpty)
  • 🔗 Stack (Linked List) - Stack implementation using singly linked list with LIFO behavior (push, pop, peek)

Heap Data Structures

  • 🔗 Min Heap - Min heap implementation with insert and popMin operations using heapify up/down (O(log n) insert/extract)

Trie Data Structure

  • 🔗 Trie - Prefix tree implementation with insert, search, and startsWith operations

Linked List Algorithms & Data Structures

Core Data Structures

Linked List Algorithms

Utilities


🛠 Tech Stack

  • TypeScript - Type-safe algorithm implementations
  • Bun - Fast JavaScript runtime and test runner
  • Biome - Code formatting and linting

🚀 Getting Started

# Install dependencies
bun install

# Run all tests
bun test

# Run tests in watch mode
bun test --watch

# Format code
bunx biome format --write

# Lint code
bunx biome lint --write

📄 License

MIT License

About

A collection of algorithm implementations in TypeScript, focusing on clarity, performance, and well-known problem-solving patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors