Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
cache-version: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production

- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-feed"
gem "jekyll-sitemap"

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
64 changes: 64 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# GitHub Pages configuration for CS_BASICS cheatsheets
title: CS_BASICS Cheatsheets
description: Computer Science fundamentals and coding interview cheatsheets
author: yennanliu
email: [email protected]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a placeholder email address. It should be replaced with a valid email or removed if not intended to be public. Leaving placeholder values in configuration can be misleading.


# Theme
theme: minima
markdown: kramdown
highlighter: rouge
plugins:
- jekyll-feed
- jekyll-sitemap

# Build settings
permalink: /:categories/:title/
exclude:
- .gitignore
- README.md
- Gemfile
- Gemfile.lock
- node_modules
- vendor
- .bundle
- .sass-cache
- _site
- archived
- workspace
- algorithm/target
- "*.class"
- "*.jar"

# Collections for organizing content
collections:
cheatsheets:
output: true
permalink: /:collection/:name/

# Defaults
defaults:
- scope:
path: "doc/cheatsheet"
type: "pages"
values:
layout: "default"
- scope:
path: "_cheatsheets"
type: "cheatsheets"
values:
layout: "default"

# Navigation
navigation:
- title: Home
url: /
- title: Cheatsheets
url: /cheatsheets/
- title: GitHub
url: https://github.com/yennanliu/CS_basics

# GitHub Pages specific
repository: yennanliu/CS_basics
github:
repository_url: https://github.com/yennanliu/CS_basics

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The github block with repository_url is redundant. The repository key on line 62 is sufficient for GitHub Pages and themes like minima to generate the correct repository URL. Removing this duplicate configuration improves maintainability.

86 changes: 86 additions & 0 deletions cheatsheets/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
layout: default
title: Cheatsheets - CS Fundamentals
permalink: /cheatsheets/
---

# Computer Science Cheatsheets

This collection contains comprehensive cheatsheets covering all major computer science topics and algorithmic patterns essential for coding interviews and software development.

## 📊 Data Structures

| Topic | Description | Link |
|-------|-------------|------|
| **Arrays** | Array operations, techniques, and patterns | [View]({{ site.baseurl }}/doc/cheatsheet/array.html) |
| **Binary Trees** | Tree traversal, construction, and manipulation | [View]({{ site.baseurl }}/doc/cheatsheet/binary_tree.html) |
| **Binary Search Trees** | BST operations and balancing | [View]({{ site.baseurl }}/doc/cheatsheet/bst.html) |
| **Graphs** | Graph algorithms, traversal, and analysis | [View]({{ site.baseurl }}/doc/cheatsheet/graph.html) |
| **Hash Maps** | Hashing techniques and collision handling | [View]({{ site.baseurl }}/doc/cheatsheet/hash_map.html) |
| **Heaps** | Priority queues and heap operations | [View]({{ site.baseurl }}/doc/cheatsheet/heap.html) |
| **Linked Lists** | List operations and pointer manipulation | [View]({{ site.baseurl }}/doc/cheatsheet/linkedlist.html) |

## 🔍 Algorithm Patterns

| Pattern | Description | Link |
|---------|-------------|------|
| **Two Pointers** | Efficient array and string processing | [View]({{ site.baseurl }}/doc/cheatsheet/2_pointers.html) |
| **Binary Search** | Efficient searching in sorted data | [View]({{ site.baseurl }}/doc/cheatsheet/binary_search.html) |
| **Sliding Window** | Subarray and substring problems | [View]({{ site.baseurl }}/doc/cheatsheet/sliding_window.html) |
| **Backtracking** | Recursive problem solving | [View]({{ site.baseurl }}/doc/cheatsheet/backtrack.html) |
| **Dynamic Programming** | Optimization and memoization | [View]({{ site.baseurl }}/doc/cheatsheet/dp.html) |
| **Greedy Algorithms** | Local optimization strategies | [View]({{ site.baseurl }}/doc/cheatsheet/greedy.html) |

## 🌐 Graph Algorithms

| Algorithm | Description | Link |
|-----------|-------------|------|
| **BFS (Breadth-First Search)** | Level-order traversal and shortest paths | [View]({{ site.baseurl }}/doc/cheatsheet/bfs.html) |
| **DFS (Depth-First Search)** | Deep exploration and connectivity | [View]({{ site.baseurl }}/doc/cheatsheet/dfs.html) |
| **Dijkstra's Algorithm** | Single-source shortest paths | [View]({{ site.baseurl }}/doc/cheatsheet/Dijkstra.html) |
| **Topological Sort** | Dependency resolution and ordering | [View]({{ site.baseurl }}/doc/cheatsheet/topological_sort.html) |

## ⚡ Advanced Topics

| Topic | Description | Link |
|-------|-------------|------|
| **Bit Manipulation** | Bitwise operations and tricks | [View]({{ site.baseurl }}/doc/cheatsheet/bit_manipulation.html) |
| **System Design** | Scalability and architecture patterns | [View]({{ site.baseurl }}/doc/cheatsheet/design.html) |
| **Intervals** | Interval merging and scheduling | [View]({{ site.baseurl }}/doc/cheatsheet/intervals.html) |
| **Math & Geometry** | Mathematical algorithms and computations | [View]({{ site.baseurl }}/doc/cheatsheet/math.html) |

## 💡 Problem-Solving Techniques

| Technique | Description | Link |
|-----------|-------------|------|
| **Pattern Recognition** | Common problem patterns and templates | [View]({{ site.baseurl }}/doc/cheatsheet/dp_pattern.html) |
| **Code Templates** | Reusable code patterns and structures | [View]({{ site.baseurl }}/doc/cheatsheet/00_template.html) |
| **Java Tricks** | Language-specific optimizations | [View]({{ site.baseurl }}/doc/cheatsheet/java_trick.html) |
| **Python Tricks** | Python-specific techniques | [View]({{ site.baseurl }}/doc/cheatsheet/python_trick.html) |

---

## 📋 Quick Reference

### Time & Space Complexity Guide
- **O(1)** - Constant time operations
- **O(log n)** - Binary search, balanced trees
- **O(n)** - Linear traversal, single pass
- **O(n log n)** - Efficient sorting, divide & conquer
- **O(n²)** - Nested loops, brute force
- **O(2ⁿ)** - Exponential, recursive backtracking

### Common Data Structure Operations

| Structure | Access | Search | Insertion | Deletion | Space |
|-----------|---------|---------|-----------|----------|-------|
| Array | O(1) | O(n) | O(n) | O(n) | O(n) |
| Dynamic Array | O(1) | O(n) | O(1)* | O(n) | O(n) |
| Hash Table | N/A | O(1)* | O(1)* | O(1)* | O(n) |
| Binary Tree | O(log n)* | O(log n)* | O(log n)* | O(log n)* | O(n) |

*Average case performance

---

*All cheatsheets are continuously updated with the latest patterns and techniques used in top-tier tech companies.*
53 changes: 53 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
layout: default
title: CS_BASICS - Computer Science Fundamentals
---

# CS_BASICS - Computer Science Fundamentals

Welcome to the CS_BASICS documentation site! This repository contains comprehensive computer science fundamentals and coding interview preparation materials.

## 📚 Available Resources

### [Cheatsheets](/cheatsheets/)
Comprehensive cheatsheets covering all major computer science topics and algorithmic patterns:

- **Data Structures**: Arrays, Linked Lists, Trees, Graphs, Hash Tables
- **Algorithms**: Sorting, Searching, Dynamic Programming, Greedy Algorithms
- **Problem Patterns**: Two Pointers, Sliding Window, Backtracking, BFS/DFS
- **System Design**: Distributed Systems, Scalability, Database Design

### Code Solutions
- **Python**: LeetCode solutions in Python
- **Java**: LeetCode solutions in Java
- **SQL**: Database problem solutions
- **Scala**: Functional programming solutions

## 🎯 Quick Navigation

| Category | Description | Link |
|----------|-------------|------|
| **Algorithms** | Core algorithm implementations | [View](/algorithm/) |
| **Data Structures** | Fundamental data structure concepts | [View](/data_structure/) |
| **LeetCode Python** | Python problem solutions | [View](/leetcode_python/) |
| **LeetCode Java** | Java problem solutions | [View](/leetcode_java/) |
| **System Design** | System design concepts and examples | [View](/system_design/) |

## 🔗 External Resources

- [LeetCode Profile](https://leetcode.com/)
- [Blind Curated 75](https://leetcode.com/list/xoqag3yj/)
- [Grind 75](https://www.techinterviewhandbook.org/grind75/)
- [NeetCode 150](https://neetcode.io/practice)

## 📈 Complexity References

The repository includes visual references for:
- Big O complexity charts
- Common data structure operation costs
- Sorting algorithm complexities
- Algorithm performance comparisons

---

*This site is automatically generated from the [CS_BASICS GitHub repository](https://github.com/yennanliu/CS_basics).*
Loading