跳到正文
cccskills
免费在 GitHub 公开

algorithms-cs-expert

Expert-level algorithms and complexity theory covering sorting, searching, graph algorithms, dynamic programming, greedy algorithms, NP-completeness, and algorithm design paradigms.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md2.6 KB
  • .gitkeep0 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Algorithms CS Expert

Before Starting

  1. Which algorithm category?
  2. Time or space optimization priority?
  3. Exact or approximate solution needed?

Core Expertise Areas

Sorting Algorithms

Comparison sorts: quicksort O(n log n) avg, mergesort O(n log n) worst, heapsort O(n log n). Non-comparison: counting sort O(n+k), radix sort O(nk), bucket sort O(n) avg. Stability: mergesort and timsort stable, quicksort and heapsort not stable. In-place: heapsort and quicksort in-place, mergesort requires O(n) extra space.

Graph Algorithms

BFS: shortest path in unweighted graphs, O(V+E), uses queue. DFS: topological sort, cycle detection, SCC, O(V+E), uses stack or recursion. Dijkstra: shortest path weighted non-negative, O(E log V) with priority queue. Bellman-Ford: handles negative weights, detects negative cycles, O(VE). Floyd-Warshall: all-pairs shortest path, O(V3), dynamic programming. Minimum spanning tree: Kruskal (sort edges + union-find), Prim (greedy + priority queue).

Dynamic Programming

Optimal substructure: optimal solution contains optimal solutions to subproblems. Overlapping subproblems: same subproblems solved multiple times without memoization. Top-down memoization: recursive with cache. Bottom-up tabulation: iterative filling of DP table. Classic problems: LCS, LIS, knapsack, matrix chain, edit distance, coin change.

Complexity Theory

Big-O classes: O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n), O(n2), O(2n). P vs NP: P decidable in polynomial time, NP verifiable in polynomial time. NP-complete: NP-hard and in NP. First: SAT. Others via reduction. Common NP-complete: SAT, 3-SAT, vertex cover, clique, TSP decision, subset sum.

Best Practices

  • Analyze both time and space complexity
  • Consider average, worst, and best case separately
  • Prove correctness before optimizing
  • Use amortized analysis for data structure operations
  • Reduce unknown problems to known ones

Common Pitfalls

PitfallFix
Off-by-one in DP tableCarefully define base cases and indices
Dijkstra on negative edgesUse Bellman-Ford instead
Ignoring integer overflowUse long or BigInteger for large inputs
Wrong complexity analysisAccount for all loops and recursive calls

Related Skills

  • data-structures-expert
  • algorithms-expert
  • compiler-expert

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Expert-level abstract algebra knowledge. Use when working with groups, rings, fields, modules, Galois theory, representation theory, or algebraic structures. Also use when the user mentions 'group', 'ring', 'field', 'homomorphism', 'isomorphism', 'normal subgroup', 'quotient group', 'Sylow theorem', 'Galois theory', 'polynomial ring', 'ideal', 'module', 'vector space', or 'representation theory'.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

Expert-level acoustics knowledge. Use when working with sound waves, acoustic propagation, resonance, standing waves, Doppler effect, room acoustics, ultrasound, noise control, musical acoustics, or architectural acoustics. Also use when the user mentions 'sound wave', 'decibel', 'frequency', 'resonance', 'standing wave', 'Doppler effect', 'acoustic impedance', 'reverberation', 'ultrasound', 'noise control', 'harmonics', or 'sound intensity'.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

Expert-level aerodynamics covering subsonic and supersonic flow, lift and drag, airfoil theory, boundary layers, compressible flow, and CFD methods.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

Expert-level air quality engineering covering pollutant sources, atmospheric dispersion, air quality standards, emission controls, and air quality modeling.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

Expert-level aircraft structures covering structural design philosophy, wing and fuselage analysis, fatigue and damage tolerance, composite structures, and certification.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

Expert-level analytical chemistry knowledge. Use when working with chromatography, spectroscopy, electroanalytical methods, sample preparation, quantitative analysis, calibration, statistics, or instrumental analysis. Also use when the user mentions 'HPLC', 'GC', 'mass spectrometry', 'atomic absorption', 'ICP', 'titration', 'calibration curve', 'detection limit', 'NMR', 'chromatography', 'electrochemistry', 'sample preparation', or 'method validation'.

中文简介正在准备中。当前显示原文说明。

luokai0/ai-agent-skills-by-luo-kai132026年5月6日 更新

查看 luokai0 的全部技能

报告此技能的问题