Is there a symbol table container in c++?
I have been thinking about this all day. I am looking for a simple way to
implement a symbol table in C++. The problem is that input that is coming
in is in the format "string_a string_b int_1 int_2" where strings form an
edge and integers are the properties of that edge. I am thinking about
using a vector to associate a string and integer values for the strings so
I can build an adjacency linked list implementation representing edges,
but then I am not sure how to proceed with assigning properties of those
edges. I am thinking about making a Graph class with vector and two ints
to represent vertices which are string_a and string_b but I need to
translate them into ints first, hence the reason for the vector, then
Graph will call makeEdge(vector[int], vector[int]) method to make the
edges. The Edges class will the contain two ints for the vertices and two
ints for the properties so then I can associate int_1 and int_2 with each
edge. Does what I plan to do make sense or am I going about this a totally
wrong way?
No comments:
Post a Comment