Skip to content

Modern LinkedList PushFront

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › LinkedList › LinkedList › PushFront

PushFront

Adds a value at the front of the list.

Syntax

PushFront( byref v as T )

Notes

  • O(1)

Examples

#import "std/containers"
using containers

dim q as LinkedList( of ustring )

q.PushBack( "b" )
q.PushFront( "a" )       '' O(1) at the front -- the reason this type exists,
                         '' since an Array cannot insert at 0 in constant time
print q.Front( )         '' a
print q.Count            '' 2

Library: LinkedList
Category: LinkedList
Documented under: Members

Clone this wiki locally