Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

02) Create a program in JAVA using INTELLIJ where you will be developing an implementation for BINARY SEARCH TREE data structure in which you need

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

02) Create a program in JAVA using INTELLIJ where you will be developing an implementation for BINARY SEARCH TREE data structure in which you need to develop a BST class in which there will be following functions to process the functionality of BINARY SEARCH TREE as a Data Structure: (20 Marks) Exception Handling should be implemented where needed! Include Runtime Complexity also for each method which you are developing as a Comment! You should not be using any predefined function for developing following functions! Proper Menu should be implemented in Main Class of your Program for taking inputs from user to execute desired functionality out of all the required functionalities! Note: Test your functions by taking following Binary Search Tree as a Data Input. (21.1 28.3 11.4 18.5) (256) 32.7 5.8 12.9 15.1 19.2) 23.3 27.4 30.5 37.6 QUESTION 2: Functionalities Required: 1) Create a method by which we can INSERT float value in BINARY SEARCH TREE. 2) Create a method by which we can FIND float value in BINARY SEARCH TREE. 3) Create a method by which we can perform Traversing using PRE ORDER TRAVERSAL. 4) Create a method by which we can perform Traversing using IN ORDER TRAVERSAL. 5) Create a method by which we can perform Traversing using LEVEL ORDER TRAVERSAL. 6) Create a method by which we can find Height of BINARY SEARCH TREE. 7) Create a method by which we can Find MAX NODE OF BINARY SEARCH TREE. 8) Create a method by which we can Find MIN NODE OF BINARY SEARCH TREE. 9) Create a method which prints all the nodes of BINARY SEARCH TREE IN ASCENDING ORDER. 10) Create a method which count the number of leaf nodes in a BINARY SEARCH TREE. Q1) Create a program in JAVA using INTELLIJ where you will be developing an implementation for functionalities which are required below: (20 Marks) Exception Handling should be implemented where needed! Include Runtime Complexity also for each method which you are developing as a comment! You should not be using any predefined function for developing following functions! Proper Menu should be implemented in Main Class of your Program for taking inputs from user to execute desired functionality out of all the required functionalities! Functionalities Required: 1) Create a method by which we can reverse given string using Recursion. String should be pass to the method as an argument after taking input from user. For example, HELLO WORLD DLROW OLLEH 2) Create a method by which we can replace each element of an array with product of every other element in array using Recursion. For example, Input: (1,5,8,2,6} Output: {480,96,60,240,80} Input: (5,4,3,2,1} Output: 24,30,40,60,120} Input: (3,5,8,4,6,7} Output: Array contains consecutive integers from 3 to 8 Input: {3,2,3,4,1} Output: Array do not contain consecutive integers as because element 3 is repeated. 4) Create a method to shuffle an array on the basis of given order of elements positions. For example, Input: array[] = {8,5,2,3,1} position[] = {1,2,0,4,3} Output: array[] = {2,8,5,1,3} 5) Create a method to find all strings of given length containing balanced parentheses. For example, Input: n = 2 Output: Input: n Output: (0) 0 Input: n = 3 Output: Invalid Input Input: n = 6 Output: ((o)) 100) (00 010) 02) Create a program in JAVA using INTELLIJ where you will be developing an implementation for BINARY SEARCH TREE data structure in which you need to develop a BST class in which there will be following functions to process the functionality of BINARY SEARCH TREE as a Data Structure: (20 Marks) Exception Handling should be implemented where needed! Include Runtime Complexity also for each method which you are developing as a Comment! You should not be using any predefined function for developing following functions! Proper Menu should be implemented in Main Class of your Program for taking inputs from user to execute desired functionality out of all the required functionalities! Note: Test your functions by taking following Binary Search Tree as a Data Input. (21.1 28.3 11.4 18.5) (256) 32.7 5.8 12.9 15.1 19.2) 23.3 27.4 30.5 37.6 QUESTION 2: Functionalities Required: 1) Create a method by which we can INSERT float value in BINARY SEARCH TREE. 2) Create a method by which we can FIND float value in BINARY SEARCH TREE. 3) Create a method by which we can perform Traversing using PRE ORDER TRAVERSAL. 4) Create a method by which we can perform Traversing using IN ORDER TRAVERSAL. 5) Create a method by which we can perform Traversing using LEVEL ORDER TRAVERSAL. 6) Create a method by which we can find Height of BINARY SEARCH TREE. 7) Create a method by which we can Find MAX NODE OF BINARY SEARCH TREE. 8) Create a method by which we can Find MIN NODE OF BINARY SEARCH TREE. 9) Create a method which prints all the nodes of BINARY SEARCH TREE IN ASCENDING ORDER. 10) Create a method which count the number of leaf nodes in a BINARY SEARCH TREE. Q1) Create a program in JAVA using INTELLIJ where you will be developing an implementation for functionalities which are required below: (20 Marks) Exception Handling should be implemented where needed! Include Runtime Complexity also for each method which you are developing as a comment! You should not be using any predefined function for developing following functions! Proper Menu should be implemented in Main Class of your Program for taking inputs from user to execute desired functionality out of all the required functionalities! Functionalities Required: 1) Create a method by which we can reverse given string using Recursion. String should be pass to the method as an argument after taking input from user. For example, HELLO WORLD DLROW OLLEH 2) Create a method by which we can replace each element of an array with product of every other element in array using Recursion. For example, Input: (1,5,8,2,6} Output: {480,96,60,240,80} Input: (5,4,3,2,1} Output: 24,30,40,60,120} Input: (3,5,8,4,6,7} Output: Array contains consecutive integers from 3 to 8 Input: {3,2,3,4,1} Output: Array do not contain consecutive integers as because element 3 is repeated. 4) Create a method to shuffle an array on the basis of given order of elements positions. For example, Input: array[] = {8,5,2,3,1} position[] = {1,2,0,4,3} Output: array[] = {2,8,5,1,3} 5) Create a method to find all strings of given length containing balanced parentheses. For example, Input: n = 2 Output: Input: n Output: (0) 0 Input: n = 3 Output: Invalid Input Input: n = 6 Output: ((o)) 100) (00 010)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions