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

Please type in MATLAB Language and also include the codes inputs and outputs. I

ID: 3813835 • Letter: P

Question

Please type in MATLAB Language and also include the codes inputs and outputs. I would like to see a detailed explanation of the problem so I fully understand what's going on behind the question. Please and Thank you

a) Do the following example by hand (show the steps clearly)
-2x1+x2+2x3=9
3x2-2x3=-1
4x3=8
b) Which part of your calculations relates to line 2?
c) Which part of your calculations relates to line 8?
d) Which part of your calculations relates to lines 5,6,7?

HW 10 Problem 1 We used the Gaus El function to solve linear system of equations in the upper triangular form (the algorithm is called forward substitution) 1 functio x Gaus El (a,b, n) 2 x (n) bo (n) /a (n,n) 3 for p n-1) 1:1. x (p) b (p) for k (pt 1) :n x (p) x (p) a (p, k x (k) end x (p) x (p) /a (p, p end a Do the following example by hand (show the steps clearl 2x1+x2+2x3 9 3x2-2x3 -1 4x3 8 b) Which part of your calculations relates to line 2? c) Which part of your calculations relates to line 8? d Which part of your calculations relates to lines 5,6,7?

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()