100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS2611 Assignment 2 2023

Rating
-
Sold
6
Pages
11
Grade
A+
Uploaded on
11-07-2023
Written in
2022/2023

COS2611 Assignment 2 2023 Complete code for both questions, Code + comments. Create a C++ program that will display a binary search tree: inorder traversal, preorder traversal, postorder traversal, and height of the tree. The nodes of the binary search tree will be read into the code using a text file.

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
July 11, 2023
Number of pages
11
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

For Assistance with other modules
Whatsapp +27682021794
www.myassignments.co.za




COS2611
Assignment 02
2023


Due date
19 July 2023,
11:00 PM
UNIQUE NUMBER: 744411

, QUESTION 1
// COS2611 Skeleton for Assessment 3
#include <iostream>
#include <fstream>
#include <string>
#include<vector>

//Add your student name and student number
//
//
//


using namespace std;

class TreeNode
{
//keep this class as is
public:

int value; //key or data
TreeNode* left;
TreeNode* right;

//constructors

TreeNode() {
value = 0;
left = NULL;
right = NULL;
} //default constructor

TreeNode(int v) {
value = v;
left = NULL;
right = NULL;
} //parametrized constructor

}; //TreeNode


class BST
{
public:
TreeNode* root;

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MyAssignments My Assignments
View profile
Follow You need to be logged in order to follow users or courses
Sold
171
Member since
4 year
Number of followers
144
Documents
38
Last sold
4 months ago
My Assignments

3,8

21 reviews

5
11
4
3
3
2
2
1
1
4

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions