Data Systems  >  STUDY GUIDE  >  HW6.txt - Syracuse University CSE 674 (All)

HW6.txt - Syracuse University CSE 674

Document Content and Description Below

//HW6 AVL Tree //Due: Saturday (Nov. 24) at 11:59PM //total point: 60 #include <iostream> //to use cout #include <algorithm> //to use max function such as i = max(a, b); using namespace std; //Y ... ou need to use the following node class for each node of the AVL tree class node { public: int value; int height; bool is_left_child; //true if this node is the left child of its parent node; else false; bool is_right_child; //true if this node is the right child of its parent node; else false; node * parent; node * l_child; node * r_child; node() {} node(int i) { value = i; height = 1; parent = l_child = r_child = nullptr; is_left_child = is_right_child = false; } }; class avl_tree { public: node * root; avl_tree() { root = nullptr; } void add_node(int i);//You need to implement this. //When there is a tie of values, continue the search toward the child branch with smaller height. //If both left and right child branch carry the same height, continue the search toward the right child branch. void in_order_traversal(node *p); //provided. void height_adjustment(node *p, node * &action_node_pointer, int &pattern); //You need to implement this /* // You need to implement this. This function is invoked by add_node and remove_node. p points to the first node that we need to check for possible height update. We then need to check possible height update toward root. All nodes whose heights need to be updated will be performed in this function. When invoked, action_node_pointer = nullptr, pattern = 0. If no imbalance is detected, action_node_pointer remains nullptr, and pattern [Show More]

Last updated: 3 years ago

Preview 1 out of 9 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of HW6.txt  -  Syracuse University CSE 674 document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$9.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

97
0

Document information


Connected school, study & course


About the document


Uploaded On

Nov 17, 2022

Number of pages

9

Written in

All

Seller


Profile illustration for Browsegrades
Browsegrades

Member since 3 years

0 Documents Sold

Additional information

This document has been written for:

Uploaded

Nov 17, 2022

Downloads

 0

Views

 97

Document Keyword Tags

Recommended For You

Get more on STUDY GUIDE »

$9.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·