Skip to content
equwalPublic

About

Efficient comparsion of length in lists.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Length Comparison

Purpose

Provide short-circuit length comparisons.

Usage

The only external function is `len`.

(len <integer or list> <list> &optional (<predicate> #'=))
(len 3 '(1 2 3)) ;=> T
(len '(a b c) '(1 2 3)) ;=> T
(len 3 '(1 2 3) #'/=) ;=> NIL

Complexity

Comparing the length of some lists with lengths in L is O(sum(L)). With a short-circuit length comparsion, the worst case scenario is the same, with the best case O(1) and average case of O(min(L)).

About

Efficient comparsion of length in lists.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages