- Type
- Quiz
- Course
- CS301 Data Structures
- Size
- PDF 814 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 1, 2, 4 of 7. Download the file for all 7 pages.
#include<iostream> #include<stdlib.h> using namespace std; class TreeNode
private: int* obj; TreeNode* left; TreeNode* right; public: TreeNode()
this->obj = NULL; this->left = this->right = NULL;
TreeNode(int* obj)
this->left = this->right = NULL;
PAID ASSIGNMENT SERVICES are AVAIBLE
CS506 Cs411 CS403 CS504 CS604 int* getInfo()
return this->obj;
void setInfo(int* obj)
TreeNode* getLeft()
return left;
void setLeft(TreeNode* left)
this->left = left;
TreeNode* getRight()
return right;
void setRight(TreeNode* right)
this->right = right;
int isLeaf()
if (this->left == NULL && this->right == NULL) return 1; return 0; bool isFull()
int getSize()
void percolateDown(int hole)
int child; int tmp = array[hole]; for (; hole * 2 <= currentSize; hole = child)
child = hole * 2; if (child != currentSize && array[child + 1] < array[child]) child++; if (array[child] < tmp) array[hole] = array[child]; else break;
array[hole] = tmp;
void buildHeap(int* anArray, int n)
for (int j = 1; j <= n; j++)
array[j] = anArray[j - 1]; currentSize = n;
for (int j = currentSize / 2; j > 0; j--)
percolateDown(j);
Related CS301 files
All CS301 files →- CS301 Quiz 2 by Junaid Quiz PDF 727 KB
- CS301 Solution 2 by Junaid (Word) Quiz DOCX 38 KB
- CS301 Highlighted Handouts Set 2 Highlighted PDF 3.7 MB
- CS301 Midterm Past Paper Fall 2003 Session 1 Midterm PDF 257 KB
- CS301 Solved Quiz by Sonu Ilyas Quiz PDF 2.7 MB
- CS301 Short Notes Lectures 1-22 Quiz PDF 626 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.