0

Hey!

I am college student training for exam. Found one problem and I know you'll know what to use straight away. Here we go:

We got a file where the excel sheet is encrypted like this:

1;2;3;=A2
;;1;4;5
;=580*A;=D2+1

Formulas are just simple ones, max. two numbers and *, /, +, -.

Output should be: all formulas solved or message about cycle.

How would you represent the data? I guess it won't be <vector>. Would that be <map> or simple array of pointers on struct

{bool solved; int number; string formula}

?

Thanks for your opinion.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by neoangin
0

With some simple representation of 'cell', your spreadsheet could just use a map<pair<int,int>, cell>. Or even (for usability) map<pair<char,int>, cell>.

On top of that, or as a modification of that, you might want some algorithm-specific information, like, maybe you want to store the indegree of each cell in the map, or inside a parallel map.

0

With some simple representation of 'cell', your spreadsheet could just use a map<pair<int,int>, cell>. Or even (for usability) map<pair<char,int>, cell>.

On top of that, or as a modification of that, you might want some algorithm-specific information, like, maybe you want to store the indegree of each cell in the map, or inside a parallel map.

WOW! Seems interesting. Gonna try it. Thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.