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

Please show all the steps as detail as possible.... I need help with this.... **

ID: 3815017 • Letter: P

Question

Please show all the steps as detail as possible.... I need help with this....

*****************************************************************

Need Help on C++ Programming. Can you show me and teach me how to make this programming.

*Make sure the programming is working and do not turn in a handwriting.

*Do not separate the file, use main.cpp that make me understand how to do this programming. Use "iostream"

*****************************************************************

What are the key characteristics of a hash table.

Give an example different from you fellow classmates.

Why bother to use one ?

*****************************************************************

What are the 5 steps to read one char at a time from a file.

Write the code, and comment it.

*****************************************************************

Define a BTS.

What are its pros and cons of BTS

How can you implement a BTS?

Explanation / Answer

1. Need Help on C++ Programming. Can you show me and teach me how to make this programming.
*Make sure the programming is working and do not turn in a handwriting.
*Do not separate the file, use main.cpp that make me understand how to do this programming. Use "iostream"

Ans :
You have to add header file first. here i have added header file iostream
#include<iostream>
than write main function and return type. here int is return type of main function. than write the defination in curly bracket. Here i am printing hello world in main function.
int main(){
std::cout<<"Hello World";
}

so here the full program

#include<iostream>
int main(){
std::cout<<"Hello World";
return 0;
}


2. What are the key characteristics of a hash table.
Give an example different from you fellow classmates.
Why bother to use one ?

Ans: Hash table is used to indexing data in different form. Here we can search data in O(1) time complexity.
example: i have 10 numbers , i want to store them in hash table than i have to use mod function.
we will get the modulo of each number by 10. and store the number in that location.
Like 15 is a number , we want to store it in hash table.
H(15) = 15 mod 10 = 5
so 15 will be stored in location 5 in array of hash.


3. What are the 5 steps to read one char at a time from a file.
Write the code, and comment it.

Ans:
#include<ifstream> //header file for file handeling
ifstream f; //make variable of file input
f.open("test.txt"); //open file with name test.txt
int n;
while(inputfile >> n){ //read file and get each number and store in n and print it usint cout.
   cout<<n<<" ";
}
f.close(); //close file
  
5.
a. Define a BTS.
Ans: Binary Search Tree, is a node-based binary tree data structure which has the following properties:
The left subtree of a node contains only nodes with keys less than the node’s key.
The right subtree of a node contains only nodes with keys greater than the node’s key.
The left and right subtree each must also be a binary search tree.
There must be no duplicate nodes.

b. What are its pros and cons of BTS
pros:
bst is used to search element in o(logn).
it store element in sorting order.
  
cons:
it may take o(n) time to search an element if the tree is skewed tree.

c.How can you implement a BTS?
Ans: to implement bst we have to use each node of struct node type.
struct node {
int key;
struct node *left;
struct node *right;
}
if new element come to insert in tree than that will be first checked by root. if that will be more than
root than pointer will be moved to right and check it again.
if element is less than root than moved to right till when there is no node.
than add the node in that.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote