/
CoinTree.h
34 lines (30 loc) · 958 Bytes
/
CoinTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Created by yolanda on 2/3/2019.
//
#ifndef SYSTEM_PROGRAMMING_1_BITCOINTREE_H
#define SYSTEM_PROGRAMMING_1_BITCOINTREE_H
#include "CoinNode.h"
class CoinTree {
private:
char *coinId;
char *initialOwner;
/* Pointer to the CoinNode */
CoinNode *root;
/* Pointer to the next CoinTree */
CoinTree *next;
public:
CoinTree(char *coinId, char *initialOwner, int value);
/* Insert new Coin */
CoinNode* insert(char *coinId, char *initialOwner, int value);
int find(char *coinId);
void printNodes(char *coinId);
CoinNode* getRoot(char *coinId);
int findUnspent(char *coinId);
int findNumberOfTransactions(char *coinId);
void traceCoin(char *coinId);
CoinTree* getNext();
void setRoot(char *owner, int value, char *coinId);
void print();
~CoinTree();
};
#endif //SYSTEM_PROGRAMMING_1_BITCOINTREE_H