PandA-2024.02
Data Structures | Macros | Typedefs | Functions | Variables
module.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for module.c:

Go to the source code of this file.

Data Structures

struct  stack
 
struct  bin_tree
 

Macros

#define MAX_NUMBER_OF_NODES   255
 

Typedefs

typedef struct stack node_stack
 
typedef struct bin_tree node_tree
 

Functions

void push_stack_free_list (node_stack **head, node_stack *new_node)
 
node_stackpop_stack_free_list (node_stack **head)
 
void init_stack_free_list ()
 
void push (node_stack **head, void *t)
 
_Bool isEmpty (node_stack *head)
 
void * pop (node_stack **head)
 
void * top (node_stack *head)
 
void push_tree_free_list (node_tree **head, node_tree *new_node)
 
node_treepop_tree_free_list (node_tree **head)
 
void init_tree_free_list ()
 
void insert (node_tree **tree, int val)
 
void print_preorder (node_tree *root)
 
void print_inorder (node_tree *root)
 
void print_postorder (node_tree *root)
 
void deltree (node_tree *root)
 
node_tree__attribute__ ((noinline))
 
int main ()
 

Variables

static node_stack StaticPoolStack [MAX_NUMBER_OF_NODES]
 
static node_stackhead_stack_free_list
 
static node_tree StaticPoolTree [MAX_NUMBER_OF_NODES]
 
static node_treehead_tree_free_list
 

Macro Definition Documentation

◆ MAX_NUMBER_OF_NODES

#define MAX_NUMBER_OF_NODES   255

Definition at line 5 of file module.c.

Referenced by init_stack_free_list(), and init_tree_free_list().

Typedef Documentation

◆ node_stack

typedef struct stack node_stack

Definition at line 14 of file module.c.

◆ node_tree

typedef struct bin_tree node_tree

Definition at line 84 of file module.c.

Function Documentation

◆ __attribute__()

node_tree* __attribute__ ( (noinline)  )

Definition at line 256 of file module.c.

References bin_tree::data, bin_tree::left, NULL, and bin_tree::right.

◆ deltree()

void deltree ( node_tree root)

Definition at line 223 of file module.c.

References isEmpty(), bin_tree::left, NULL, pop(), push(), push_tree_free_list(), bin_tree::right, and top().

Here is the call graph for this function:

◆ init_stack_free_list()

void init_stack_free_list ( )

Definition at line 40 of file module.c.

References index, MAX_NUMBER_OF_NODES, and push_stack_free_list().

Here is the call graph for this function:

◆ init_tree_free_list()

void init_tree_free_list ( )

Definition at line 111 of file module.c.

References index, MAX_NUMBER_OF_NODES, and push_tree_free_list().

Here is the call graph for this function:

◆ insert()

void insert ( node_tree **  tree,
int  val 
)

Definition at line 119 of file module.c.

References bin_tree::data, insert(), bin_tree::left, NULL, pop_tree_free_list(), and bin_tree::right.

Here is the call graph for this function:

◆ isEmpty()

_Bool isEmpty ( node_stack head)

Definition at line 56 of file module.c.

References NULL.

◆ main()

int main ( void  )

Definition at line 267 of file module.c.

References bin_tree::data, deltree(), init_stack_free_list(), init_tree_free_list(), insert(), NULL, print_inorder(), print_postorder(), and print_preorder().

Here is the call graph for this function:

◆ pop()

void* pop ( node_stack **  head)

Definition at line 60 of file module.c.

References stack::data, isEmpty(), stack::next, push_stack_free_list(), and top().

Here is the call graph for this function:

◆ pop_stack_free_list()

node_stack* pop_stack_free_list ( node_stack **  head)

Definition at line 26 of file module.c.

References stack::next, and NULL.

◆ pop_tree_free_list()

node_tree* pop_tree_free_list ( node_tree **  head)

Definition at line 97 of file module.c.

References bin_tree::left, and NULL.

◆ print_inorder()

void print_inorder ( node_tree root)

Definition at line 163 of file module.c.

References bin_tree::data, isEmpty(), bin_tree::left, NULL, pop(), push(), and bin_tree::right.

Here is the call graph for this function:

◆ print_postorder()

void print_postorder ( node_tree root)

Definition at line 190 of file module.c.

References bin_tree::data, isEmpty(), bin_tree::left, NULL, pop(), push(), bin_tree::right, and top().

Here is the call graph for this function:

◆ print_preorder()

void print_preorder ( node_tree root)

Definition at line 141 of file module.c.

References bin_tree::data, isEmpty(), bin_tree::left, NULL, pop(), push(), and bin_tree::right.

Here is the call graph for this function:

◆ push()

void push ( node_stack **  head,
void *  t 
)

Definition at line 48 of file module.c.

References stack::data, stack::next, and pop_stack_free_list().

Here is the call graph for this function:

◆ push_stack_free_list()

void push_stack_free_list ( node_stack **  head,
node_stack new_node 
)

Definition at line 20 of file module.c.

References stack::data, and stack::next.

◆ push_tree_free_list()

void push_tree_free_list ( node_tree **  head,
node_tree new_node 
)

Definition at line 90 of file module.c.

References bin_tree::data, bin_tree::left, and bin_tree::right.

◆ top()

void* top ( node_stack head)

Definition at line 73 of file module.c.

References stack::data, bin_tree::left, and bin_tree::right.

Variable Documentation

◆ head_stack_free_list

node_stack* head_stack_free_list
static

Definition at line 18 of file module.c.

◆ head_tree_free_list

node_tree* head_tree_free_list
static

Definition at line 88 of file module.c.

◆ StaticPoolStack

node_stack StaticPoolStack[MAX_NUMBER_OF_NODES]
static

Definition at line 17 of file module.c.

◆ StaticPoolTree

node_tree StaticPoolTree[MAX_NUMBER_OF_NODES]
static

Definition at line 87 of file module.c.


Generated on Mon Feb 12 2024 13:03:03 for PandA-2024.02 by doxygen 1.8.13