// CMSC 341 - Spring 2020 - Project 3 #include #include "Scanner.h" // Balance function for use with BSTs. This implements the // height-balance property for AVL trees. Returns true if // height-balance property is violated. bool Scanner::heightImbalance(int leftHeight, int rightHeight, int leftSize, int rightSize) { return (leftHeight > rightHeight + 1) || (rightHeight > leftHeight + 1); } // SNode constructor. bounds contains the upper and lower bounds on // the weights for this BST. Scanner::SNode::SNode(pair bounds) { _bounds = bounds; _root = new BST(heightImbalance); _left = _right = nullptr; } Scanner::SNode::~SNode() { // TBD } // Initialize a Scanner object to process an image with 'lines' lines // of text, each of which is 'range' characters long. The ASCII // characters corresponding to the character indices are passed in // 'chars'. Scanner::Scanner(int lines, int range, vector chars) { // TBD } Scanner::~Scanner() { // TBD } Scanner::Scanner(const Scanner& rhs) { // TBD } Scanner& Scanner::operator=(const Scanner& rhs) { // TBD return *this; } // Read the data files and insert into the datastructure. File in // 'ascii' contains the scrambled character indices; file 'weights' // contains the corresponding weights. bool Scanner::loadFiles(string ascii, string weights) { // TBD return true; } // Insert a node; splay the node that is inserted. bool Scanner::insert(int weight, int ch) { // TBD return true; } void Scanner::dump() const { // TBD } void Scanner::inorder() const { // TBD }