Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

skiplist(3tcl) [debian man page]

struct::skiplist(3tcl)						Tcl Data Structures					    struct::skiplist(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
struct::skiplist - Create and manipulate skiplists SYNOPSIS
package require Tcl 8.2 package require struct::skiplist ?1.3? skiplistName option ?arg arg ...? skiplistName delete node ?node...? skiplistName destroy skiplistName insert key value skiplistName search node ?-key key? skiplistName size skiplistName walk cmd _________________________________________________________________ DESCRIPTION
The ::struct::skiplist command creates a new skiplist object with an associated global Tcl command whose name is skiplistName. This command may be used to invoke various operations on the skiplist. It has the following general form: skiplistName option ?arg arg ...? Option and the args determine the exact behavior of the command. Skip lists are an alternative data structure to binary trees. They can be used to maintain ordered lists over any sequence of insertions and deletions. Skip lists use randomness to achieve probabilistic balancing, and as a result the algorithms for insertion and deletion in skip lists are much simpler and faster than those for binary trees. To read more about skip lists see Pugh, William. Skip lists: a probabilistic alternative to balanced trees In: Communications of the ACM, June 1990, 33(6) 668-676. Currently, the key can be either a number or a string, and comparisons are performed with the built in greater than operator. The follow- ing commands are possible for skiplist objects: skiplistName delete node ?node...? Remove the specified nodes from the skiplist. skiplistName destroy Destroy the skiplist, including its storage space and associated command. skiplistName insert key value Insert a node with the given key and value into the skiplist. If a node with that key already exists, then the that node's value is updated and its node level is returned. Otherwise a new node is created and 0 is returned. skiplistName search node ?-key key? Search for a given key in a skiplist. If not found then 0 is returned. If found, then a two element list of 1 followed by the node's value is retuned. skiplistName size Return a count of the number of nodes in the skiplist. skiplistName walk cmd Walk the skiplist from the first node to the last. At each node, the command cmd will be evaluated with the key and value of the current node appended. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category struct :: skiplist of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
skiplist CATEGORY
Data structures COPYRIGHT
Copyright (c) 2000 Keith Vetter struct 1.3 struct::skiplist(3tcl)

Check Out this Related Man Page

struct::queue(n)						Tcl Data Structures						  struct::queue(n)

__________________________________________________________________________________________________________________________________________________

NAME
struct::queue - Create and manipulate queue objects SYNOPSIS
package require Tcl 8.4 package require struct::queue ?1.4.2? queueName option ?arg arg ...? queueName clear queueName destroy queueName get ?count? queueName peek ?count? queueName put item ?item ...? queueName unget item queueName size _________________________________________________________________ DESCRIPTION
The ::struct namespace contains a commands for processing finite queues. It exports a single command, ::struct::queue. All functionality provided here can be reached through a subcommand of this command. Note: As of version 1.4.1 of this package a critcl based C implementation is available. This implementation however requires Tcl 8.4 to run. The ::struct::queue command creates a new queue object with an associated global Tcl command whose name is queueName. This command may be used to invoke various operations on the queue. It has the following general form: queueName option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for queue objects: queueName clear Remove all items from the queue. queueName destroy Destroy the queue, including its storage space and associated command. queueName get ?count? Return the front count items of the queue and remove them from the queue. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are not enoughs items in the queue to fulfull the request, this command will throw an error. queueName peek ?count? Return the front count items of the queue, without removing them from the queue. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are not enoughs items in the queue to fulfull the request, this command will throw an error. queueName put item ?item ...? Put the item or items specified into the queue. If more than one item is given, they will be added in the order they are listed. queueName unget item Put the item into the queue, at the front, i.e. before any other items already in the queue. This makes this operation the comple- ment to the method get. queueName size Return the number of items in the queue. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category struct :: queue of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
graph, list, matrix, pool, prioqueue, record, set, skiplist, stack, tree CATEGORY
Data structures struct 1.4.2 struct::queue(n)
Man Page