Skip to content

Commit f6628dd

Browse files
committed
class name change in bfs code
1 parent dc023cd commit f6628dd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Headers/0003_Graph/0001_BreadthFirstSearch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Node
1818
Node(char value);
1919
};
2020

21-
class BFSGraph
21+
class Graph
2222
{
2323
private:
2424
map<Node*, list<Node*>> _adjlist;

SourceCodes/0003_Graph/0001_BreadthFirstSearch.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Node::Node(char value)
1515
parent = NULL;
1616
}
1717

18-
Node* BFSGraph::MakeOrFindNode(char value)
18+
Node* Graph::MakeOrFindNode(char value)
1919
{
2020
Node* node = NULL;
2121
if (this->_nodeMap.find(value) == this->_nodeMap.end())
@@ -30,7 +30,7 @@ Node* BFSGraph::MakeOrFindNode(char value)
3030
return node;
3131
}
3232

33-
void BFSGraph::BreadthFirstSearch(Node* node)
33+
void Graph::BreadthFirstSearch(Node* node)
3434
{
3535
node->color = WHITE;
3636
node->distance = 0;
@@ -58,7 +58,7 @@ void BFSGraph::BreadthFirstSearch(Node* node)
5858
}
5959
}
6060

61-
void BFSGraph::PushUndirectedEdge(char valueU, char valueV)
61+
void Graph::PushUndirectedEdge(char valueU, char valueV)
6262
{
6363
Node* nodeU = this->MakeOrFindNode(valueU);
6464
Node* nodeV = this->MakeOrFindNode(valueV);
@@ -67,12 +67,12 @@ void BFSGraph::PushUndirectedEdge(char valueU, char valueV)
6767
this->_adjlist[nodeV].push_back(nodeU);
6868
}
6969

70-
void BFSGraph::BFS(char value)
70+
void Graph::BFS(char value)
7171
{
7272
this->BreadthFirstSearch(this->_nodeMap[value]);
7373
}
7474

75-
vector<pair<char, int>> BFSGraph::ShowBFSResult()
75+
vector<pair<char, int>> Graph::ShowBFSResult()
7676
{
7777
vector<pair<char, int>> result;
7878
for (auto& node : this->_nodeMap)

Tests/0003_Graph/0001_BreadthFirstSearchTest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace BreadthFirstSearchTest
99

1010
TEST(BFSTesting, ShowBFSResultTest01)
1111
{
12-
BFSGraph graph;
12+
Graph graph;
1313

1414
graph.PushUndirectedEdge('s', 'r');
1515
graph.PushUndirectedEdge('s', 'w');
@@ -31,7 +31,7 @@ namespace BreadthFirstSearchTest
3131

3232
TEST(BFSTesting, ShowBFSResultTest02)
3333
{
34-
BFSGraph graph;
34+
Graph graph;
3535

3636
graph.PushUndirectedEdge('s', 'r');
3737

0 commit comments

Comments
 (0)