Write a program to perform deletion operation on BST. While deleting, consider all the deletion cases.
a. Deletion of node with degree 0.
b. Deletion of node with degree 1.
c. Deletion of node with degree 2.
Write a program to implement a binary search tree (BST) having following functionalities.
BSTInsert(): This function adds a given ITEM to the BST. If the ITEM already exists in the BST then it
will not insert the ITEM any more.
BSTInorderStack(): This function finds Inorder traversal sequence of a BST using stack. You are not
supposed to use recursive implementation of Inorder traversal
Write a program to take input a URL(website address). The input has to be validated as per the following rules : -
The program should throw separate exception object with an error code and error message as data member, for each of the rule, and display the appropriate message. Include a catch all block. If no exception occurs, then the program displays the URL.
Write a program to input a mail_id . Check the validity of the input given as per the following rules : -
If the entered string is not valid, throw an exception and display appropriate message. The string input should be taken in main. The exception is thrown in a function called from main. Exception handling code should be in main as well as in the called function. [ Hint: Rethrow the exception]
Write a Python program to access the Furniture spreadsheet, update the price of tables, and then create a new excel spreadsheet called updatedfurniture. Create a dictionary for the price updates and update the prices via a loop, increasing the row number to include all the rows in the spreadsheet. Do not change the formatting of the original spreadsheet. Be sure to check your updatedFurniture spreadsheet to verify that the Total price of the furniture increased. The new Total price amount should be $273,938.20.
The placement season has begun in a college. There are N number of students standing outside an interview room in a line. It is given that a person who goes in first has higher chances of getting selected.
Input1- an integer N, which denotes the number of students present
Input2- An array of size N, denoting the problem solving capacity of the students.
Each student has a number associated with them known as the problem-solving capability (PSC). The higher the capability, the higher the chances of selection. Now, each student wants to know the number of students ahead of him/her who have more problem-solving capability than him/her.
Find this number for each student.
Steve has a string of lowercase characters in range ascii[‘a’..’z’]. He wants to reduce the string to its shortest length by doing a series of operations. In each operation, he selects a triple of adjacent lowercase letters that match, and he deletes them. For instance, the string aaab could be shortened to b in one operation. Steve’s task is to delete as many characters as possible using this method and print the resulting string. If the final string is empty, print "Empty String" without quotes. Characters can be deleted only if they form a triple and are the same(i.e. from aaaa we can only delete 3 a's and will be left with a single a).
You are required to write a C++ program that implements the above algorithm by using the Stack class.
Example:
Sample Input: aaaabcccdd
Sample Output: abdd
PSEUDOCODE
Tip, Tax, and Total
Design a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total.
FLOWCHART AND PSEUDOCODE
Convert decimal no. to its binary equivalent
HAND TRACING
Accept the two sides and an angle included by these two sides, and find the area and third side of a triangle.
(1) Display "Enter two sides and an angle:"
(2) Accept a, b,theta
(3) ang = theta * 3.14 / 180;
(4) third_side = sqrt (a*a + b*b - 2*a*b* cos(ang))
(5) area = ½*a*b* sin(ang)
(6) Display "Third_side =",third_side,"Area =", area
(7) Exit