Skip to content
LUDA · 學思辨行

LUDA · 學思辨行

Learn extensively, Understand deeply, Discern clearly, and Act resolutely.

  • About
  • Learning Path

Category: Greedy

How fractional knapsack packs by value density

November 13, 2026By HoHo Zhao

Short answer: The fractional knapsack problem allows any fraction of an item. Sort by value per unit weight and take items from the densest until the next item does not fit. Fill the remaining capacity with a fraction of that item. The greedy choice is optimal for the fractional…

Algorithms, GreedyLeave a comment

How activity selection takes the earliest finish

November 13, 2026By HoHo Zhao

Short answer: Activity selection chooses a largest set of mutually compatible intervals. Sort the activities by finishing time and take the next activity that starts at or after the finish of the last chosen one. The greedy choice is optimal: some maximum set uses an activity that finishes first,…

Algorithms, GreedyLeave a comment
  • Algorithms
  • Arithmetic
  • Authelia
  • Clustering
  • Coding
  • Compression
  • Cryptography
  • CSS
  • Distributed Systems
  • Docker
  • Dynamic Programming
  • Exact Algorithms
  • Games
  • Geometry
  • Grafana
  • Graphs
  • Greedy
  • Heaps
  • Homelab
  • IPsec
  • LDAP
  • Linear Algebra
  • Logging
  • Loki
  • nginx
  • Number Theory
  • Numerical
  • Optimization
  • Parsing
  • Prometheus
  • Randomization
  • Range Queries
  • Sampling
  • Scheduling
  • Search
  • Searching
  • Sequences
  • Sketches
  • Sorting
  • Streams
  • Strings
  • SVG
  • Synchronization
  • Systems
  • Transforms
  • Trees

Docker EAP-MSCHAPv2 FreeRADIUS Grafana gzip IKEv2 IPsec LogQL Loki OpenLDAP Promtail StrongSwan

© 2026 LUDA · 學思辨行. Powered by WordPress.