0

I can't decide what data structure to use for a program I'm making.

the program I'm making is a football table, the variables used so far are;
string team;
int played = 0, goalsfor = 0, goalsagainst = 0, goaldiff = 0, win = 0, draw = 0, lose = 0, points = 0;

I was originally thinking of using a vector as I can resize it when I set it up. the table is organised by the points initialy and in the event of a tie goal difference is used.

I was thinking of using quicksort to organise it.

any advice?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dflatt
0

I'd probably use a database, because tables like this usually end up needing far more robust querying than I'd want to write ad hoc. But I don't see a problem with a vector of objects where each object represents the match up if all you're doing is updating, sorting, and displaying the table.

0

I'd probably use a database, because tables like this usually end up needing far more robust querying than I'd want to write ad hoc. But I don't see a problem with a vector of objects where each object represents the match up if all you're doing is updating, sorting, and displaying the table.

thanks

This question has already been answered. 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.