COMS4771 ML HW4

COMS 4771 SP21 HW4 Due: Fri Apr 09, 2021 at 11:59pm This homework is to be done alone. No late homeworks are allowed. To receive credit, a type- setted copy of the homework pdf must be uploaded to Gradescope by the due date. You must show your work to receive full credit. Discussing possible solutions […]

COMS4771 ML HW4 Read More »

Map

// Implementation of the Map ADT #include #include #include #include #include #include “Map.h” struct map { * Creates a new map with the given number of cities * Assumes that `numCities` is positive Map MapNew(int numCities) { return NULL; * Frees all memory allocated to the given map void MapFree(Map m) { * Returns the

Map Read More »

COMP2521 23T2 Assignment 1

// COMP2521 23T2 Assignment 1 #ifndef MSET_STRUCTS_H #define MSET_STRUCTS_H // DO NOT CHANGE THE NAME OF THIS STRUCT struct node { int item; // DO NOT CHANGE/REMOVE THIS FIELD int count; // DO NOT CHANGE/REMOVE THIS FIELD struct node *left; // DO NOT CHANGE/REMOVE THIS FIELD struct node *right; // DO NOT CHANGE/REMOVE THIS FIELD

COMP2521 23T2 Assignment 1 Read More »

COMP2521 23T2 Assignment 1

// Implementation of the Multiset ADT using a balanced BST // COMP2521 23T2 Assignment 1 #include #include #include #include #include “Mset.h” #include “MsetStructs.h” //////////////////////////////////////////////////////////////////////// // Basic Operations * Creates a new empty mset Mset MsetNew(void) { return NULL; * Frees all memory allocated to the given mset void MsetFree(Mset s) { * Inserts one of

COMP2521 23T2 Assignment 1 Read More »

testMap

// Main program for testing the Map ADT #include #include #include #include #include “Map.h” void testSetName(void); void testInsertRoad(void); void testGetRoadsFrom(void); int main(int argc, char *argv[]) { testSetName(); testInsertRoad(); testGetRoadsFrom(); void testSetName(void) { Map m = MapNew(5); char name1[] = “sydney”; assert(strcmp(MapGetName(m, 0), “unnamed”) == 0); MapSetName(m, 0, name1); // Overwriting the name1 string with something

testMap Read More »

COMP2521 23T2 Assignment 1

Assignment 1 Efficient Multiset ADT All important changes to the assignment specification and files will be listed here. [20/06 09:00] Assignment released [20/06 14:05] Added the definition of struct cursor to MsetStructs.h and fixed a typo in testMset.c [21/06 23:05] Added some clarifications about the expected behaviour of MsetCursorNext and MsetCursorPrev To implement a multiset

COMP2521 23T2 Assignment 1 Read More »