pofk_algorithm 0.1.0
pofk_algorithm: ^0.1.0 copied to clipboard
A fast, extensible Dart library for algorithms and data structures, offering search, sort, and AI utilities. Over 500 algorithms planned in future versions.
0.1.0 - 2025-08-10 #
What's New (Advanced Graph Algorithms, 2025-08-10) #
Added #
The total number of algorithms is 169.
Advanced Graph Algorithms (New)
johnsonsAlgorithm(Johnson's Algorithm: All-Pairs Shortest Paths)edmondsKarp(Edmonds-Karp: Maximum Flow)dinicsAlgorithm(Dinic's Algorithm: Maximum Flow)findEulerianPath(Eulerian Path/Circuit)findHamiltonianPath(Hamiltonian Path/Cycle)chinesePostman(Chinese Postman Problem)stoerWagnerMinCut(Stoer–Wagner Minimum Cut)transitiveClosure(Transitive Closure, Floyd-Warshall)graphColoring(m-Coloring Problem)spfa(Shortest Path Faster Algorithm)tarjansSCC(Tarjan's Algorithm: SCC)findBridges(Bridge Finding Algorithm)treeDiameter(Tree Diameter in Graphs)hierholzer(Hierholzer's Algorithm: Eulerian Trail)yensAlgorithm(Top-K Shortest Paths, Yen's Algorithm)
Examples #
- Added
example/graph_advanced_example.dartwith usage demos for all new advanced graph algorithms.
Changed #
- Exported all new advanced graph algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all advanced graph algorithms in
test/graph_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
Changelog #
0.0.5 - 2025-08-10 #
The total number of algorithms is 155.
Added #
Advanced String Algorithms (New)
manacherLongestPalindrome(Manacher’s Algorithm: Longest Palindromic Substring)boyerMooreSearch(Boyer-Moore Search)zAlgorithm(Z-Algorithm for Pattern Matching)rollingHashSearch(Rolling Hash for Substring Matching)longestRepeatingSubstring(Longest Repeating Substring)removeConsecutiveDuplicates(Remove Consecutive Duplicates)minWindowSubsequence(Minimum Window Subsequence)atoi(String to Integer)intToRoman/romanToInt(Integer to Roman / Roman to Integer)stringPermutations(Generate All Permutations of a String)
Examples #
- Added
example/string_advancedexample.dartwith usage demos for all new advanced string algorithms.
Changed #
- Exported all new advanced string algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all advanced string algorithms in
test/string_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
[0.0.5] - 2025-08-10 #
The total number of algorithms is 145.
Added #
Advanced Map Algorithms (New)
invertMap(Invert Map: Key and Value Inversion)mergeMaps(Merge Two Maps with Conflict Resolution)groupAnagrams(Group Anagrams)wordFrequencyRanking(Word Frequency Ranking)allPairsWithSum(Find All Pairs with Given Sum, HashMap approach)indexMapping(Index Mapping for Elements)MRUCache(Most Recent Key Access)countPairsWithDiff(Counting Pairs with Specific Difference)findSubarraysWithSum(Find Subarrays with Given Sum)minWindowSubstring(Minimum Window Substring, Map + Sliding Window)
Examples #
- Added
example/map_advancedexample.dartwith usage demos for all new advanced map algorithms.
Changed #
- Exported all new advanced map algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all advanced map algorithms in
test/map_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
[0.0.5] - 2025-08-10 #
The total number of algorithms is 135.
Added #
Advanced Set Algorithms (New)
symmetricDifference(Symmetric Difference)powerSet(Power Set Generation)isSubset(Subset Check)isSuperset(Superset Check)isDisjoint(Disjoint Check)listToSetPreserveOrder(Convert List to Set while preserving order)MultiSet(Bag) Operations: union, intersection, difference, count
Examples #
- Added
example/set_advancedexample.dartwith usage demos for all new advanced set algorithms.
Changed #
- Exported all new advanced set algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all advanced set algorithms in
test/set_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
[0.0.5] - 2025-08-10 #
The total number of algorithms is 128.
Added #
Advanced List Sorts & Selection Algorithms (New)
heapSort(Heap Sort)shellSort(Shell Sort)gnomeSort(Gnome Sort)oddEvenSort(Odd-Even Sort)pancakeSort(Pancake Sort)cycleSort(Cycle Sort)bucketSort(Bucket Sort)radixSort(Radix Sort)pigeonholeSort(Pigeonhole Sort)bitonicSort(Bitonic Sort)combSort(Comb Sort)stoogeSort(Stooge Sort)quickselect(Quickselect, kth smallest/largest)lisBinarySearch(Longest Increasing Subsequence, O(n log n))maxProductSubarray(Maximum Product Subarray)
Examples #
- Added
example/list_advanced_sortsexample.dartwith usage demos for all new advanced sorts and selection algorithms.
Changed #
- Exported all new advanced sorts and selection algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all advanced sorts and selection algorithms in
test/list_advanced_sorts/. - Detailed documentation and time/space complexity for each algorithm.
0.0.41 - 2025-08-10 #
The total number of algorithms is 113. The total number of algorithms is now higher (added matrix algorithms).
Added #
Matrix Algorithms (New)
flood_fill(DFS Flood Fill)island_count_dfs(Island Count via DFS)island_count_bfs(Island Count via BFS)shortest_path_in_grid(BFS Shortest Path)word_search(Word Search in Grid)path_sum(Path Sum in Matrix)matrix_rotation(Rotate Matrix 90°)spiral_traversal(Spiral Order Traversal)surrounded_regions(Capture Surrounded Regions)
Examples #
- Added
example/matrixexample.dartwith usage demos for all new matrix algorithms.
Changed #
- Exported all new matrix algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all matrix algorithms in
test/matrix_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
0.0.4 - 2025-08-10 #
The total number of algorithms is 104.
Added #
Backtracking Algorithms (New)
n_queens(N-Queens Problem)sudoku_solver(Sudoku Solver)subset_generation(All Subsets / Power Set)permutations(All Permutations)word_search(Word Search in Grid)combinations(k-Combinations)combination_sum(Combination Sum)letter_combinations_phone_number(Phone Number Letter Combos)rat_in_a_maze(Rat in a Maze Paths)
Examples #
- Added
example/backtrackingexample.dartwith usage demos for all new backtracking algorithms.
Changed #
- Exported all new backtracking algorithms from
lib/pofk_algorithm.dart.
Added Tests & Docs #
- Full test suite for all backtracking algorithms in
test/backtracking_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
Dynamic Programming (DP) Algorithms (New)
fibonacci_memoization(Memoized Fibonacci)knapsack_01(0/1 Knapsack)longest_increasing_subsequence(LIS, O(n log n))longest_common_subsequence(LCS)edit_distance(Levenshtein Distance, DP version)matrix_path_sum(Minimum Path Sum in Grid)coin_change(Minimum Coins)subset_sum(Subset Sum DP)partition_equal_subset_sum(Equal Subset Partition)house_robber(Max Non-Adjacent Sum)jump_game(Reachability)alternating_subsequences(Longest Alternating Subsequence)rod_cutting(Max Revenue Rod Cutting)
Examples #
- Added
example/dpexample.dartwith usage demos for all new DP algorithms.
Changed #
- Exported all new DP algorithms from
lib/pofk_algorithm.dart(except duplicateedit_distance).
Added Tests & Docs #
- Full test suite for all DP algorithms in
test/dp_algorithms/. - Detailed documentation and time/space complexity for each algorithm.
Tree Algorithms (New)
binary_tree_node(generic tree node)- Tree traversals:
inorderTraversal,preorderTraversal,postorderTraversal level_order_traversal(BFS)tree_depth(height calculation)invert_tree(mirror tree)lowest_common_ancestor(LCA)validate_bst(BST validation)tree_diameter(longest path)balanced_tree_check(height-balanced check)- Tree serialization:
serialize_tree/deserialize_tree zigzag_traversal(alternating level order)
Linked List Algorithms (New)
linked_list_node(generic singly linked list node)doubly_linked_list_node(generic doubly linked list node)- Insert/delete at specific positions
- Reverse linked list (iterative, recursive, in groups, between positions)
- Cycle detection (Floyd's algorithm)
- Merge two sorted linked lists
- Remove nth node from end
- Palindrome check for linked list
- Find intersection of two lists
Detailed Tree Module #
- BinaryTreeNode — Generic binary tree node with left/right children
- Tree Traversals:
inorderTraversal<T>,preorderTraversal<T>,postorderTraversal<T> - Level Order Traversals:
levelOrderTraversal<T>,zigzagTraversal<T> - Tree Properties:
treeDepth<T>,treeDiameter<T>,isBalancedTree<T> - Tree Operations:
invertTree<T>,lowestCommonAncestor<T>,validateBST<T extends Comparable> - Serialization:
serializeTree<T>,deserializeTree<T>
Changed #
- Exported all new tree algorithms from
lib/pofk_algorithm.dart - Updated
README.mdwith comprehensive tree algorithms section - Enhanced
example/pofk_algorithm_example.dartwith basic tree operations - Added detailed tree algorithm demos in
example/tree_algorithms_example.dart
Added Tests & Docs #
- Full test suite for tree algorithms in
test/tree_algorithms/ - Detailed documentation including time/space complexity
- Generic type support (
<T>) for all algorithms, BST validation constrained toT extends Comparable
0.0.30 - 2025-08-09 #
Added #
Graph Algorithms
- BFS, DFS, Topological Sort
- Connected Components, Cycle Detection (directed/undirected)
- Bipartite Graph Check
- Shortest Path (unweighted BFS)
- Weighted Edge utility
- Dijkstra, Bellman-Ford, Floyd-Warshall
- MST: Kruskal, Prim
- Kosaraju SCC, Articulation Points
- Union-Find (alias of
DisjointSet)
Changed #
- Improved
example/pofk_algorithm_example.dartwith structured examples across all modules.
Fixed #
- Resolved compile issues in graph algorithms (generic consts, reverse usage)
- Corrected test expectations in
min_sum
0.0.2 - 2025-07-24 #
Initial Release #
List Algorithms
- Linear Search, Binary Search, Merge Sort, Bubble Sort, Insertion Sort, Selection Sort, Quick Sort, Counting Sort
- Reverse List, Find Max/Min, Find Duplicates
- Kadane's Algorithm, Max Sum Subarray of Size K, Min Sum, Average Subarray
- Two Sum (sorted), Remove Duplicates, Rotate Array Right, Prefix Sum
Set Algorithms
- Has Duplicates, Disjoint Set, Find Intersection, Set Difference, Frequency Uniqueness, Has Two Sum, Has Unique Window
Map Algorithms
- Frequency Count, Group By Key, First Non-Repeated Element, Anagram Checker, Two Sum, LRU Cache, Most Frequent Element, Top K Frequent, Length of Longest Substring
String Algorithms
- Reverse String, Palindrome Checker, Anagram Checker, Longest Palindromic Substring, String Compression
- Brute Force Search, KMP Search, Rabin-Karp Search
- Longest Common Prefix, Edit Distance, Count Vowels and Consonants