linkedlist.hpp File Reference

#include "linkedlist_internals.hpp"

Go to the source code of this file.

Functions

int list_size (const Node *n)
 Size of the list from the node n.
Celllist_ith (Node *n, unsigned int i)
 Value at the position i (starting from 0).
Nodelist_erase (Node *n, Node *pos)
 Erase the value at position at node 'pos' of a list with head at 'n'.
Nodelist_insert (Node *n, Node *pos, Cell *c)
 Insert the value before the position 'pos' of a list with head at 'n'.
Nodelist_insert_int (Node *n, Node *pos, const int value)
 Insert an int before the position 'pos' of a list with head at 'n'.
Nodelist_insert_double (Node *n, Node *pos, const double value)
 Insert a double before the position 'pos' of a list with head at 'n'.
Nodelist_insert_symbol (Node *n, Node *pos, const char *value)
 Insert a symbol before the position 'pos' of a list with head at 'n'.


Detailed Description

Encapsulates an abstract interface layer for a sequence ADT, without using member functions. Makes no assumptions about what kind of concrete type Cell will be defined to be.

Function Documentation

Node* list_erase ( Node n,
Node pos 
)

Erase the value at position at node 'pos' of a list with head at 'n'.

Returns:
Pointer to the value after the position pos

Node* list_insert ( Node n,
Node pos,
Cell c 
)

Insert the value before the position 'pos' of a list with head at 'n'.

Returns:
Pointer to the inserted node

Node* list_insert_double ( Node n,
Node pos,
const double  value 
)

Insert a double before the position 'pos' of a list with head at 'n'.

Returns:
Pointer to the inserted node

Referenced by main().

Node* list_insert_int ( Node n,
Node pos,
const int  value 
)

Insert an int before the position 'pos' of a list with head at 'n'.

Returns:
Pointer to the inserted node

Referenced by main().

Node* list_insert_symbol ( Node n,
Node pos,
const char *  value 
)

Insert a symbol before the position 'pos' of a list with head at 'n'.

Returns:
Pointer to the inserted node

Referenced by main().

Cell* list_ith ( Node n,
unsigned int  i 
)

Value at the position i (starting from 0).

Returns:
Pointer to the value at position i in the list

int list_size ( const Node n  ) 

Size of the list from the node n.

Returns:
List size

Referenced by main().


Generated on Tue Sep 16 10:30:40 2014 for COMP2012H by  doxygen 1.5.8