Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

post code and screenshot results Run the program here crease aeemparary SAs data

ID: 3813702 • Letter: P

Question


post code and screenshot results

Run the program here crease aeemparary SAs data se called voter: data voter put Age Party ines Add formats for Age (a-10, 31-30, s1-70, 71 Party (D Denoerae. Republican and Quesl-Ques4 rangly Disagree, 2 DR agree. opinion, agree, 5-st Agree). In addition, lahel Ques l-Quest follows: The pread dent se doing a good job Congreso doing good job Note: Use PROC PRINT to list the observations in this dala sel and PROC FREQ tn st frequencies the four questions. IThe default action of PROC PRINT o head each column with a variable name, not the label. To use labels as column headings, use the LABELoprion with PROC PRINT 2 You want to see frequencies for Questions I to 4 from the previous question. sagree combine strongly Disagree and Disagree), No opinion, and Generally Maree combine Agre e and strongly agree) Accomp his using a new format for Ques -Ques4

Explanation / Answer

#include <iostream>
#include <cstdlib>
#define MAX_VALUE 65536
using namespace std;

/* category Node */

class Node
;

/* category ThreadedBinarySearchTree */

class ThreadedBinarySearchTree
builder */
ThreadedBinarySearchTree()
  

/* perform to clear tree */
void makeEmpty()
  

/* perform to insert a key */
void insert(int key)

else if (p->key > key)
  
else
  
}
Node *tmp = new Node();
tmp->key = key;
tmp->rightThread = tmp->leftThread = true;
if (p->key < key)
facet */
tmp->right = p->right;
tmp->left = p;
p->right = tmp;
p->rightThread = false;
}
else
  
}

/* perform to look for a part */
bool search(int key)
come false;
tmp = tmp->right;
}
else if (tmp->key > key)
come false;
tmp = tmp->left;
}
else
come true;
}
}
}

/* Fuction to delete a part */
void Delete(int key)

else if (dest->key > key)
  
else
  
}
Node *target = dest;
if (!dest->rightThread && !dest->leftThread)
2 children*/
p = dest;
/* realize largest node at left kid */
target = dest->left;
whereas (!target->rightThread)
  
/* exploitation replace mode*/
dest->key = target->key;
}
if (p->key >= target->key)

else if (target->rightThread)
{
Node *largest = target->left;
whereas (!largest->rightThread)
  
largest->right = p;
p->left = target->left;
}
else
{
Node *smallest = target->right;
whereas (!smallest->leftThread)
  
smallest->left = target->left;
p->left = target->right;
}
}
else
  
else if (target->rightThread)
{
Node *largest = target->left;
whereas (!largest->rightThread)
  
largest->right = target->right;
p->right = target->left;
}
else
{
Node *smallest = target->right;
whereas (!smallest->leftThread)
  
smallest->left = p;
p->right = target->right;
}
}
}

/* perform to print tree */
void printTree()
{
Node *tmp = root, *p;
for (;;)
{
p = tmp;
tmp = tmp->right;
if (!p->rightThread)
{
whereas (!tmp->leftThread)
  
}
if (tmp == root)
break;
cout<<tmp->key<<" ";
}
cout<<endl;
}
};

/* Main Contains Menu */

int main()