GithubHelp home page GithubHelp logo

isadoraferrao / bst-for-categories-of-products. Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 59 KB

Implement a BST to catalog product categories from an online store (e.g., Submarino, Amazon). Each category has a code and a name. The code is a sequential number. For each category there is a set of products (e.g., 5000 different smartphones). Each product is identified by a code, a name, a manufacturer, model, launch year and price. Each product category must be represented, also, as a BST. In other words, the category tree node value will point to a BST that contains the products of the respective category. The input file, for loading the BSTs, is a CSV file. The default CSV separator is a semicolon (;). However, the user must be able to define any separator for each CSV file, such as "#" and "@". Example input CSV file: Laptop; 12345; Lenovo; 12346; IBM; Model X51; 2014; 1200.00 Laptop; 12347; Latitude; 12348; Dell; Model 21; 2015; 1811.00 Tablet; 12349; iPad; 12350; Apple; II; 2014; 2200.00 Smartphone; 12351; iPhone; 12352; Apple; V; 2014; 3200.00 Scripts to generate input files of any size: Code sample: generation of categories and products Archive Example input file with 200 categories and 300 products per category: Assignment 1: example CSV file (200 categories with 300 products each) Implement the following functions for BSTs: - put (insert new element in the tree) - get (return a pointer to the tree node that contains the searched key) - delete (delete an element from the tree) - contains (check whether the tree contains an X key or not) - size (return the size of a tree, i.e., number of elements below the X key) - min (return the lowest value key) - max (return the key with the highest value) - rank (return the number of elements whose key is less than key X) - height (return the height of the tree) - floor (return the smallest element closest to the X key) - ceiling (return the largest element closest to the X key) - inorder traversal (browse the tree in "inorder" order, i.e., list tree elements in ascending order) What to deliver: a complete version of the work. In other words, the first version of all of the above functions. The user must be able to choose the function through a program execution parameter. Here is the format of the input parameters: put: -p <input_put.csv> get: -g <entrada_get.csv> delete: -d <input_delete.csv> contains: -c <entry_contains.csv> size: -s (prints the size of all trees) min: -m (print the minimum of all trees) max: -M (return the key with the highest value) rank: -R <rank.csv> height: -H (return the height of all trees) floor: -F <entrada_floor.csv> ceiling: -C <entrada_ceiling.csv> opts_sequence: -S <operations_execution_string. example: pgdcM> inorder traversal: -i (browse all trees in "inorder" order, i.e., list tree elements in ascending order) File format entrada_get.csv, entrada_delete.csv, entrada_contains.csv, entrada_rank.csv, entrada_floor.csv, entrada_ceiling.csv: A list containing one "type" and one "key" per line. The type (category or product) and the key are separated by ";". In the case of product, the line contains the category and product information. So there are two types of lines. Lines that only identify one category and lines that identify a category and a product. Example of the contents of the files entrada_contains.csv, entrada_delete.csv, entrada_contains.csv, entrada_rank.csv, entrada_floor.csv, entrada_ceiling.csv: category; 12345 category; 12345; product; 12346 category; 12349 category; 12351 category; 12351; product; 12352 category; 12351; product; 12354 category; 12359; product; 12355 category; 12359; product; 12399 category; 12359; product; 12101 category; 12366 category; 12377 category; 12359; product; 12203 Name: Isadora Garcia FerrΓ£o Registration: 151151387 Name: Sherlon Almeida da Silva Registration: 151150179 * /

C 100.00%

bst-for-categories-of-products.'s Introduction

πŸš€ Computer scientist passionate about technology πŸ‘©β€πŸ’»

bst-for-categories-of-products.'s People

Contributors

isadoraferrao avatar

Watchers

 avatar

Forkers

jony342-matos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.