Problem Description:

There are at least two ways to store/maintain training dataset for the purpose of using Naive Bayes Classifier:

Your tasks:

Using the data set CarData.csv used in assignment 3 as an example, design a data structure and related algorithms to make it possible that a program can both maintain incrementally added training data items and perform the classification task using Naive Bayes Classifier in time and space efficient ways.