Highlights
To gain experience with
In lecture, we learn about trees and primarily focus on binary trees – those in which each node can have at most 2 children. In this assignment, we are exploring the n-ary tree or general trees in which nodes can have multiple children rather than a strict limit of 2.Since binary trees are limited to at most 2 children from each node, the implementation is very simple by having 2 node instance variables: left and right. In the general tree, we will use an array to contain the children from each node since we don't know how many children will be coming from each node so it doesn't make sense to have individual nodevariables the way we did in the binary tree.Once the "LinkedNaryTree" (general tree) class is completed, the second part of the assignment is to create a class called ShapeTree. The ShapeTree is a tree that will store objects of the custom class Shape (provided to you) which will represent geometric shapes that have a colour and a number of lines based on its geometric properties (i.e. a triangle has 3 sides, a square has 4 sides, etc.). The interesting and challenging feature of the ShapeTree is that when a new node is added to the
tree, there are specific rules that must be followed:
1. A node can have up to x children, where x is the number of lines in that node's contained Shape, i.e. a node containing a circle can only have 1 child, a node containing a triangle can have up to 3 children, etc. (Note: for the purposes of this assignment, we will consider a Star to have 5 lines)
2. A node cannot have a child whose Shape is the same colour as the node's Shape (i.e. a node containing a blue shape cannot have a child that containing a blue shape).
3. There cannot be sibling nodes (nodes of the same parent) that contain Shapes of the same colour, i.e. a node containing a red shape cannot have a sibling node that also contains a red node, etc.)
4. Nodes should be added as high (close to the root) as possible without breaking the above rules. After that, they should be added as far to the left as possible without breaking the above rules.
This CS1027- IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.