Prakticke aspekty vývoje softwaru: Projekt 1 – Testování
1.0
Projekt zaměřený na osvojení praktik testování včetně technik test driven development, black box testing a white box testing.
|
Zobrazit dokumentaci tohoto souboru.
20 #ifndef RED_BLACK_TREE_H_
21 #define RED_BLACK_TREE_H_
26 #include "red_black_tree_lib.h"
43 BLACK = ::Color_t::BLACK
88 bool bIsNew = BTInsertNode(&
m_pRoot, key, &pNewNode);
90 return std::make_pair(bIsNew, pNewNode);
103 std::vector<std::pair<bool, Node_t *> > &outNewNodes) {
106 std::vector<Node_t *> newNodes(keys.size());
107 std::vector<int> newNodesState(keys.size());
108 BTInsertNodeMany(&
m_pRoot, keys.size(), &keys[0], &newNodes[0],
111 for(
size_t i = 0; i < keys.size(); ++i)
112 outNewNodes.push_back(std::make_pair(newNodesState[i] != 0, newNodes[i]));
122 return BTDeleteNode(&
m_pRoot, key);
133 return BTFindNode(
m_pRoot, key);
145 BTGetLeafNodes(
m_pRoot, &count, NULL);
147 outLeafNodes.resize(count);
150 BTGetLeafNodes(
m_pRoot, &count, &outLeafNodes[0]);
162 BTGetAllNodes(
m_pRoot, &count, NULL);
164 outAllNodes.resize(count);
167 BTGetAllNodes(
m_pRoot, &count, &outAllNodes[0]);
180 BTGetNonLeafNodes(
m_pRoot, &count, NULL);
182 outNonLeafNodes.resize(count);
185 BTGetNonLeafNodes(
m_pRoot, &count, &outNonLeafNodes[0]);
199 #endif // RED_BLACK_TREE_H_
bool DeleteNode(int key)
DeleteNode Pokusi se odstranit uzel s hodnotou "key".
Definition: red_black_tree.h:121
Color_t
The Color_t enum Barva uzlu stromu.
Definition: red_black_tree.h:41
The BinaryTree class Samo-vyvazujici se binarni strom, kde hodnoty jsou ulozeny pouze ve vnitrnich uz...
Definition: red_black_tree.h:34
void GetAllNodes(std::vector< Node_t * > &outAllNodes)
GetAllNodes Projde cely strom a sestavi pole ukazatelu na vsechny uzly ve stromu.
Definition: red_black_tree.h:159
The Node_t struct Struktura uzlu stromu.
Definition: red_black_tree_lib.h:42
BinaryTree()
BinaryTree Konstruktor prazdneho binarniho stromu.
Definition: red_black_tree.h:64
Node_t * m_pRoot
Ukazatel na koren stromu.
Definition: red_black_tree.h:195
::Node_t Node_t
The Node_t struct Struktura uzlu stromu.
Definition: red_black_tree.h:50
void GetNonLeafNodes(std::vector< Node_t * > &outNonLeafNodes)
GetNonLeafNodes Projde cely strom a sestavi pole ukazatelu na vsechny NE-listove uzly stromu (tedy s ...
Definition: red_black_tree.h:177
~BinaryTree()
BinaryTree Destruktor binarniho stromu, odstrani vsechny uzly v nem obsazene.
Definition: red_black_tree.h:72
void InsertNodes(const std::vector< int > &keys, std::vector< std::pair< bool, Node_t * > > &outNewNodes)
InsertNodes Pokusi se vlozit uzly ze seznamu "keys", nebo nalezne, ty ktere jiz existuji.
Definition: red_black_tree.h:102
std::pair< bool, Node_t * > InsertNode(int key)
InsertNode Pokusi se vlozit novy uzel s hodnotou "key", nebo nalezne jiz existujici uzel s touto hodn...
Definition: red_black_tree.h:85
Node_t * GetRoot()
GetRoot.
Definition: red_black_tree.h:192
Node_t * FindNode(int key) const
FindNode Pokusi se nalezt uzel s hodnotou "key".
Definition: red_black_tree.h:132
void GetLeafNodes(std::vector< Node_t * > &outLeafNodes)
GetLeafNodes Projde cely strom a sestavi pole listovych uzlu, ktere nemaji potomky.
Definition: red_black_tree.h:142