Skip to content

Commit

Permalink
begin deboog szechuan, thoughts and prayers
Browse files Browse the repository at this point in the history
  • Loading branch information
dangerrangerous committed May 23, 2017
1 parent e30d21d commit 2c50a98
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 48 deletions.
39 changes: 4 additions & 35 deletions 2-3-4_B_Tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,42 +396,11 @@ void Tree234::RecursiveDisplayTree(TwoThreeFourNode* inNode, int level, int chil
}
} // end RecursiveDisplayTree()

/*
void Tree234::DeleteItem(long key)
{
Delete(root, key);
} // end DeleteItem()

/*
DataItem* Tree234::Delete(TwoThreeFourNode* rootPointer, long key)
{
TwoThreeFourNode* current = rootPointer;
bool keyIsInTree;
// Handle 3 cases.
// Case 1: Item is in leaf and there are at least 2 keys in the node
// Find the node and index of the key
// check that key is in the tree
if (Find(key) != -1)
{
keyIsInTree = true;
}
else
{
keyIsInTree = false;
}
int index = current->FindIndex(key);
// Key is in this node
if (index < 3 && current->dataItemArray[index]->data == key)
{
}
// temp for test
return 0;
}
*/

void TwoThreeFourNode::Remove(long key)
Expand Down Expand Up @@ -560,10 +529,10 @@ int TwoThreeFourNode::GetPredecessor(int index)
while (!current->b_IsLeaf())
{
current = current->childArray[current->numItems];

// return the last key of the leaf
return current->dataItemArray[numItems- 1]->data;
}

// return the last key of the leaf
return current->dataItemArray[numItems - 1]->data;
}

int TwoThreeFourNode::GetSuccessor(int index)
Expand Down
4 changes: 2 additions & 2 deletions 2-3-4_B_Tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ class Tree234
TwoThreeFourNode* GetNextChild(TwoThreeFourNode* inNode, long inValue);
bool IsEmpty();
void DisplayTree();
void DeleteItem(long key);
// void DeleteItem(long key);

void RemoveFromTree(long key);

private:

void RecursiveDisplayTree(TwoThreeFourNode* inNode, int level, int childNumber);
DataItem* Delete(TwoThreeFourNode* rootPointer, long key);
// DataItem* Delete(TwoThreeFourNode* rootPointer, long key);


TwoThreeFourNode* root;
Expand Down
3 changes: 2 additions & 1 deletion 2-3-4_B_Tree_Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ int main()

tree234.DisplayTree();

tree234.DeleteItem(42);



return 0;
}
Expand Down
Binary file modified Debug/2-3-4_B_.E48060A2.tlog/CL.write.1.tlog
Binary file not shown.
1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172-cvtres.read.1.tlog

This file was deleted.

1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172-cvtres.write.1.tlog

This file was deleted.

1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172-rc.read.1.tlog

This file was deleted.

1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172-rc.write.1.tlog

This file was deleted.

1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172.read.1.tlog

This file was deleted.

1 change: 0 additions & 1 deletion Debug/2-3-4_B_.E48060A2.tlog/link.6172.write.1.tlog

This file was deleted.

Binary file modified Debug/2-3-4_B_.E48060A2.tlog/link.command.1.tlog
Binary file not shown.
Binary file modified Debug/2-3-4_B_.E48060A2.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Debug/2-3-4_B_.E48060A2.tlog/link.write.1.tlog
Binary file not shown.
Empty file.
Binary file modified Debug/2-3-4_B_Tree.obj
Binary file not shown.
7 changes: 3 additions & 4 deletions Debug/2-3-4_B_Tree_Project.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
 2-3-4_B_Tree.cpp
c:\users\brian\onedrive\documents\visual studio 2015\projects\2-3-4_b_tree_project\2-3-4_b_tree_project\2-3-4_b_tree.cpp(567): warning C4715: 'TwoThreeFourNode::GetPredecessor': not all control paths return a value
2-3-4_B_Tree.obj : error LNK2019: unresolved external symbol "private: class DataItem * __thiscall Tree234::Delete(class TwoThreeFourNode *,long)" (?Delete@Tree234@@AAEPAVDataItem@@PAVTwoThreeFourNode@@J@Z) referenced in function "public: void __thiscall Tree234::DeleteItem(long)" (?DeleteItem@Tree234@@QAEXJ@Z)
C:\Users\Brian\onedrive\documents\visual studio 2015\Projects\2-3-4_B_Tree_Project\Debug\2-3-4_B_Tree_Project.exe : fatal error LNK1120: 1 unresolved externals
 2-3-4_B_Tree_Project.cpp
2-3-4_B_Tree_Project.vcxproj -> C:\Users\Brian\onedrive\documents\visual studio 2015\Projects\2-3-4_B_Tree_Project\Debug\2-3-4_B_Tree_Project.exe
2-3-4_B_Tree_Project.vcxproj -> C:\Users\Brian\onedrive\documents\visual studio 2015\Projects\2-3-4_B_Tree_Project\Debug\2-3-4_B_Tree_Project.pdb (Full PDB)
Binary file modified Debug/2-3-4_B_Tree_Project.obj
Binary file not shown.
Binary file modified Debug/vc140.idb
Binary file not shown.
Binary file modified Debug/vc140.pdb
Binary file not shown.

0 comments on commit 2c50a98

Please sign in to comment.