Skip to main content

LinkedList.filter

Filter the Linkedlist based on a function. Returns a new Linkedlist

Usage

filter(func: Callable[[Any], Any])

Parameters:
      func : Callable
            A function to filter the values by

Returns:
      LinkedList
            A new LinkedList containing the filtered values

Example

from jellybeans.structures import LinkedListLL1 = LinkedList([10, 3, 7, 29])print(LL1.filter(lambda x:x>9)) # 10 => 29