NVMLib  very early alpha
A library to optimally use a Hybrid RAM setup.
hashmap_debug_example.c File Reference
#include "../hashmap.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for hashmap_debug_example.c:

Go to the source code of this file.

Data Structures

struct  a_st
 File contains a example test program for the generic Hash map implemented. More...
 

Typedefs

typedef struct a_st att
 File contains a example test program for the generic Hash map implemented. More...
 

Functions

int compare (att *a, att *b)
 
void print_obj (att *entry)
 
int get_hash (att *entry)
 
int main ()
 

Typedef Documentation

◆ att

typedef struct a_st att

File contains a example test program for the generic Hash map implemented.

The Output of the program looks like: Inserting : ONE 0 —> size = 0 || 1 —> size = 1 || ONE |

Inserting : TWO 0 —> size = 0 || 1 —> size = 2 || ONE | TWO |

Inserting : THREE 0 —> size = 0 || 1 —> size = 3 || ONE | TWO | THREE |

Inserting : FOUR 0 —> size = 1 || FOUR | 1 —> size = 0 || 2 —> size = 1 || ONE | 3 —> size = 2 || TWO | THREE |

Inserting : FIVE 0 —> size = 2 || FOUR | FIVE | 1 —> size = 0 || 2 —> size = 1 || ONE | 3 —> size = 2 || TWO | THREE |

Inserting : SIX 0 —> size = 1 || FOUR | 1 —> size = 1 || FIVE | 2 —> size = 1 || SIX | 3 —> size = 0 || 4 —> size = 1 || ONE | 5 —> size = 0 || 6 —> size = 1 || TWO | 7 —> size = 1 || THREE |

Inserting : SEVEN 0 —> size = 1 || FOUR | 1 —> size = 1 || FIVE | 2 —> size = 1 || SIX | 3 —> size = 0 || 4 —> size = 2 || ONE | SEVEN | 5 —> size = 0 || 6 —> size = 1 || TWO | 7 —> size = 1 || THREE |

Inserting : EIGTH 0 —> size = 1 || FOUR | 1 —> size = 1 || FIVE | 2 —> size = 1 || SIX | 3 —> size = 0 || 4 —> size = 3 || ONE | SEVEN | EIGTH | 5 —> size = 0 || 6 —> size = 1 || TWO | 7 —> size = 1 || THREE |

Finding: FOUND TWO

MAP SIZE : Before deletion – 6 Erased 1 Erased 2 MAP SIZE : After deletion – 5 0 —> size = 1 || FOUR | 1 —> size = 1 || FIVE | 2 —> size = 1 || SIX | 3 —> size = 0 || 4 —> size = 3 || ONE | SEVEN | EIGTH | 5 —> size = 0 || 6 —> size = 0 || 7 —> size = 1 || THREE |

MAP SIZE : After reinsertion – 7 0 —> size = 0 || 1 —> size = 1 || FOUR | 2 —> size = 1 || FIVE | 3 —> size = 0 || 4 —> size = 0 || 5 —> size = 1 || SIX | 6 —> size = 0 || 7 —> size = 0 || 8 —> size = 2 || SEVEN | EIGTH | 9 —> size = 1 || ONE | 10 —> size = 0 || 11 —> size = 0 || 12 —> size = 0 || 13 —> size = 1 || TWO | 14 —> size = 0 || 15 —> size = 1 || THREE |

Function Documentation

◆ compare()

int compare ( att a,
att b 
)

Definition at line 105 of file hashmap_debug_example.c.

◆ get_hash()

int get_hash ( att entry)

Definition at line 116 of file hashmap_debug_example.c.

◆ main()

int main ( )

Definition at line 125 of file hashmap_debug_example.c.

Here is the call graph for this function:

◆ print_obj()

void print_obj ( att entry)

Definition at line 112 of file hashmap_debug_example.c.