Write a code in c++ that can count the number of parent and child nodes in a search binary. For reference, if we have nodes that looked like this 20 10 5 43 there would be 2 parent nodes and 4 child nodes.
Q: Using Python, define a class Numbers and implement the built-in functions_iter__() and_next_( ). In…
A: Code: import randomclass Numbers:def __iter__(self):self.counter=0self.n=0return selfdef…
Q: . Derive the circuit for 3-bit Even-Parity-Generator with explanation of Truth table and exclusive…
A: Even parity means having even number of ones in the binary code of any number. Let us first write…
Q: Identify three basic problems that a computer may develop and indicate any troubleshooting skills…
A: The three basic problems that a computer may develop are: 1)Application runs slowly. 2)Computer is…
Q: Describe what vulnerabilities 'WannaCry' (ransomware) exploites to infect its target systems
A: WannaCry Ransomware The WannaCry ransomware is made up of several parts. It comes in the form of a…
Q: List and describe the main applications of stacks in computer programmes.
A: Introduction: Stacks, as we all know, have a wide range of uses in computer programming. The…
Q: What is the mechanism for determining whether a security breach has occurred?
A: Any occurrence that leads to unauthorized access to data, applications, services, networks, and/or…
Q: Mobile devices are unlikely to be able to replace computers for everything, all of the time. For…
A: Introduction: In actuality, a computer is an electrical device that accepts input and produces an…
Q: What are the benefits and drawbacks of using a distributed database management system?
A: answer is
Q: Please help with Search Analysis Imagine it is your lucky day, and you are given 100 golden…
A: FOR SOLUTION SEE STEP NO. 2
Q: Identify and discuss all of the technology, devices, software, and applications that contribute to…
A: We need several software, Devices, technologies, and applications that help to run the internet,…
Q: What are the advantages and disadvantages of transporting data from one location to another using a…
A: Intro In a PC, a bus is a correspondence framework that moves information between parts inside a…
Q: Create an array of months of year, name it Days, and initialize it with month of the year: 1)- find…
A: We have shared the code below with above instructions , Code is in C++ , Dev c++ Firstly, an array…
Q: What exactly is an index? What are the benefits and drawbacks of utilising indexes? How do you make…
A: answer is
Q: How do you balance the 'need' for technology with the challenges or issues it faces?
A: IT is overflowing with a valuable open door and challenges. There are a lot of choices to master…
Q: Describe the controls you would use to secure your organization's network against cyber attacks.…
A: Introduction: the controls you would use to secure your organization's network against cyber…
Q: Wireless movement is the process through which a base station or access point moves from one base…
A: Introduction: A switch may connect all of the wireless LAN's access points (APs). The switch's…
Q: What would you say to your boss if you were requested to include a project buffer for the whole…
A: Introduction: It might sometimes be difficult to spot inflated job estimates. The adoption of a…
Q: Are there any recommendations for lowering network risk?
A: Justification: Network risk management is to detect, analyze, and control threats to a company's…
Q: Certain features of a database relation may be encrypted for security reasons. Why are encrypted…
A: Introduction: It's impossible to index on an encrypted value unless it encrypts to the same value…
Q: Make a note of the directory structure of the UNIX operating system and its significance.
A: Introduction UNIX is a command-based operating system in which the users are interacting with the…
Q: Using an online DES calculator, show the output of two blocks that differ by exactly one bit. a.…
A: The Answer start from step-2.
Q: Is it feasible on a UNIX system to write a quick message? Identify and describe six UNIX-based file…
A: Introduction: Write a brief description of the UNIX operating system? Identify and describe six UNIX…
Q: What is the fundamental reason why servlets outperform programmes written in C or C++, despite the…
A: Servlets: It is a server-side component that provides web-based applications for the server.…
Q: How many non-isomorphic connected graphs are there with seven vertices, seven edges, and three…
A: The term "non isomorphic" means "not having the same form" and it is used in many branches of…
Q: What are the research differences between library subscription databases and popular search engines…
A: Introduction Library Subscription databases Used to search articles about specific topics.…
Q: Justify why a management role, rather than the user Satoshi, should provide a permission when a…
A: Introduction: In SQL, roles are granted the authority to do certain actions. Consider an employee…
Q: n a requirements review, who should be involved? Examine the methods for validating the…
A: Introduction: A requirement review is a process in which a group of individuals read and evaluate…
Q: write a method that returns the maximum of two given integers(in java)
A: The java code for the above given question is given below:
Q: Give an overview of the PicsArt software's history. How to get them, the creator's identity, the…
A: Introduction: Piccard Picture & Video Editor is a photo and video editing software with social…
Q: What are the advantages of CSS sprites?
A: Introduction: Because each picture generates an HTTP request on its own, a web page with a large…
Q: a spreadshee nat shows all the floating-point numbers for the 9-bit floating point numbers with one…
A: Sign bit means we can have both positive and negative numbers. 4 bit Exponent means we can have…
Q: What negative impact did 'WannaCry' malware have on its victims and their systems?
A: Introduction: When it comes to malware, WannaCry is a game changer.
Q: Disc drive activity commands can be understood by?
A: Introduction: Disk controllers are capable of deciphering commands for disc drive operations.
Q: Justify the significance of computers in scientific research by providing examples.
A: Introduction: Computers used in scientific research can evaluate data in ways and at speeds that are…
Q: Describe how Google Jigsaw is use information technology to combat the societal pressures listed…
A: Extremism Jigsaw utilizes research and technology to help identify and intervene in the online…
Q: What is the definition of an interface
A: A interface is a device or a framework that irrelevant elements use to cooperate. As indicated by…
Q: computer science - What are the uses of decision trees?
A: Introduction: A decision tree is primarily used to classify data, both numerically and…
Q: Create a table that compares all of the different network topologies.
A: There are two types of network topologies: physical logical Physical topology confirms the physical…
Q: In today's world, a large number of individuals use social media. In a professional setting, this…
A: Introduction: Social networking is used as a tool by people all over the globe. Its purpose is to…
Q: Data mining methods grew out of which 3 fields?
A: According to the information given:- We have to define the Data mining methods in 3 fields.
Q: Where is all of a certain user's data or files preserved in the Unix file system?
A: Introduction Linux is a set of free and open-source operating systems that is like Unix and is based…
Q: Examine the differences between traditional outsourcing and Software as a Service. When should a…
A: Introduction: Examine the differences between traditional outsourcing and Software as a Service.…
Q: Function name Function description Function Function output(s) / input(s) return value(s)…
A: We can implement all the functions by opening file and reading it.
Q: Exi: If A=the odd numbers between (1,20), B= ti even numbers between (2,20) find (1)A+B, (2)A.B, (…
A: A=[1 3 5 7 9 11 13 15 17 19]; ' B=[2 4 6 8 10 12 14 16 18 20]; A+B gives element wise addition of…
Q: NEED HELP WITH THIS import random print(random.randint(1,6)) #prints a number between 1 and 6. #or:…
A: import random#functiondef try_your_luck(dice1, dice2): #cases given in question #sum is >…
Q: This is owing to the fact that today's computers are extremely powerful. What reasons have…
A: Introduction: We must emphasise the importance of using computers in our educational system, as well…
Q: How to combine a AND operation for A937 and B8F2. Please sghow step by step
A: Answer: A937 AND B8F2 = 1010100000110010
Q: 2. Write an expression using either random or randrange to calculate the following: a. A random int…
A: Python Program for the above code is below:
Q: Sequential and direct access are the two methods for finding data in memory. Discuss why today's…
A: Introduction: Sequential access, as the name indicates, retrieves data from the memory/storage unit…
Q: computer science - Why is all-subsets regression better to stepwise regression?
A: Intro Stepwise regression chooses a model by automatically adding or eliminating individual…
Code with comments and output screenshot
Step by step
Solved in 2 steps
- Suppose Arr is a very large array of integer elements. The size of Arr is unknown. The first k elements are positive integers, greater than 0 and less than 1000, in increasing sorted order. The rest of the elements are greater than 1000.Write a function that determines whether a given positive integer, key, of value less than 1000 is an element in Arr or not. If the key is present in Arr, it returns its index otherwise it returns -1. The Time Complexity of the function shall be O(log(n)).(Note: It is to be remembered that both the size of Arr and k are unknown.)Array index is starting from 1 not 0 [pseudo code needed]Example:Arr: 4 5 7 12 15 24 67 221 233 430 500 1100 1200 1150 1050 1200 …key: 15returned value: 5Arr: 5 9 9 12 19 29 67 67 120 220 330 400 700 1001 1100 1150 1050 11250 1200 …key: 900returned value: -1CAN THE SOLUTION BE SUBMITTED WITH TEXT AND NOT A PDF IMAGE PLEASE! This assignment requires you to write a non-verbose input-driven java program for maintaining a binary search tree (BST) of integer elements (negative, zero or positive). The speciality of your BST will be that itwill record the frequency of occurrence for each integer element in it. Actions provisioned on the BST. When your program is running, a user should be able to select one of the following actions to be performed on the BST. 1. Insert an element into the BST2. Search for an element in the BST3. Find the maximum element from the BST4. Find the minimum element from the BST5. Print the elements in the BST in preorder6. Print the elements in the BST in postorder7. Print the elements in the BST in inorder8. Delete an element Anything else to exit the program. The user will provide their choice of action on the BST, by entering one of the numbers between 1 to 8 thatcorrespond to their choice. For example, if the…In C++, I need help to implement a Breadth-First Search (BFS). Display the list of colors. The colors used should be in the following order: {Blue, Brown, Green, Lavender, Orange, Pink, Red, Yellow, Violet, Gold, Gray, Indigo, Silver}
- Write a program in C++ to create a Binary Search tree (BST) of integers. The program will perform these operations: Insert node(s), Traverse In-order, Search node, Delete node, Leaf Count, Parent of a node and Quit. Use the header file similar to this: #include #ifndef BT_H #define BT_H using namespace std; class BT { private: struct node { int data; node* left; node* right; }; node* root; public: BT(); bool isEmpty() const { return root == NULL; } void insert(int); void print_inorder(); void inorderTrav(node*); void searchBST (int); void deleteNode(int); int count (); int leafCount(node*); void nodeParent(int); //Constructor //Check for empty //Insert item in BST //In-order traversing driver //In-order traversing //Searches BST for a specific node //Delete item from BST //Count driver //Counts number of leaves in BST //Finds parent of a node }; #endif Use the following menu in your program. MENU 1. Insert node(s) 2. Traverse In-order 3. Search node 4. Delete node 5. Leaf Count 6.…What would be a way in implementing the Josephus problem in C++ using a vector or a list? That takes in three parameters, one the number of knights for the knight parameter. The second parameter, "skip", is the number of knights to skip and to execute the next night. Then the third parameter "start", is the index of the knight to execute first.Implement a list of employees using a dynamic array of strings.Your solution should include functions for printing list, inserting and removingemployees, and sorting lists (use Bubble sort in C++ language).Keep list of employees sorted within the list after insertion.See the following example:How many employees do you expect to have?5 (Carriage Return)Menu :1 . Print full list of employees2 . Insert new employee3 . Remove employee from list0 . Exit2 (Carriage Return)Input name of new employee : MikeMenu :1 . Print full list of employees2 . Insert new employee3 . Remove employee from list0 . Exit1(Carriage Return)1 . MaryMenu :1 . Print full list of employees2 . Insert new employee3 . Remove employee from list0 . Exit
- Need help making a java file that combines both linearSearch and binarySearch •Both search methods must use the Comparable<T> interface and the compareTo() method.•Your program must be able to handle different data types, i.e., use generics.•For binarySearch, if you decide to use a midpoint computation formula that is different fromthe textbook, explain that formula briefly as a comment within your code. //code from textbook //linearSearch public static <T> boolean linearSearch(T[] data, int min, int max, T target) { int index = min; boolean found = false; while (!found && index <= max) { found = data [index].equals(target); index++; } return found; } //binarySearch public static <T extends Comparable<T>> boolean binarySearch(T[] data, int min, int max, T target) { boolean found = false; int midpoint = (min + max)/2; if (data[midpoint].compareTo(target)==0)…I have an assignment that requires me to read strings from a text file and insert them into a binary search tree. I am having a hard time reading the data from the file and passing it through a function. This is the code I have right now: struct tree_node {char *data;tree_node *left;tree_node *right;}; char **Read();tree_node *create_node(char **val); int main(){tree_node *root= NULL, *temp_node;char **val = (char**)malloc(sizeof(char*)*17);for (int i = 0; i < 17; i++) {val[i] = (char*)malloc(sizeof(char)*strlen(*val));}temp_node = create_node(val);root = insert(root, temp_node);printf("In Order: ");inorder(root);printf("\n");return 0;} char **Read() {int size;FILE *fp = fopen("in.txt", "r");fscanf(fp, "%d", &size);char** value = (char**)malloc(sizeof(char*));for(int i = 0; i < size; i++) {fscanf(fp, "%s", &value[i]);} fclose(fp);return value;} tree_node *create_node(char **val) {tree_node* temp = (tree_node*)malloc(sizeof(tree_node));for(int i = 0; i < 17; i++)for(int…Computer Science Done in Perl. Someone gave me a wrong/incomplete answer. Write a function, hashsum, which takes a hash reference as its first argument and an array reference as its second argument. The function should take the elements of the array and use them as keys in the hash. The values in the hash corresponding to the keys in the array should be totaled, and the sum should be returned to the user. If a key passed in the array does not exist in the hash, ignore it. Write a sample program to call this function.
- Write a C++ source code that utilizes the generation of random numbers to make sentences.The program must utilize four arrays of pointers to the character called article, noun, verb,and preposition. The program ought to make a sentence by choosing a word aimlessly fromeach array in the accompanying order: article, noun, verb, preposition, article, and noun. Aseach word is picked, it ought to be connected to the previous words in a cluster that issufficiently huge to hold the whole sentence. The words ought to be isolated by spaces. At thepoint when the last sentence is yield, it should begin with a capital letter and end with a period.The program ought to create 20 such sentencesIntroduction For this assignment, you are to write a program which implements a Sorted List data structure using a circular array-based implementation and a driver program that will test this implementation. The Sorted List ADT is a linear collection of data in which all elements are stored in sorted order. Your implementation has to store a single int value as each element of the list and support the following operations: 1. add(x) – adds the integer x to the list. The resulting list should remain sorted in increasing order. The time complexity of this operation should be 0(N), where N is the size of the list. 2. removefirst() - deletes the first integer from the list and returns its value. The remaining list should remain sorted. Time complexity of this operation should be 0(1). 3. removelast() – deletes the last integer from the list and returns its value. The remaining list should remain sorted. Time complexity of this operation should be 0(1). 4. exists(x) – returns true if the…In C program, Implement intArray_remove( intArray_t* ia, unsigned int indexToBeRemoved ) and intArray_append( intArray_t* ia, int newElement ) function below. All the information is given. /* * dataStructure.h * * Provides a bound-checked data structure made of an array of integers * in which duplicated elements are allowed. * * The interface of this data structure includes several utility * functions that operate on this array of integers as well as * file i/o functions: saving into and loading from json files. * * Do not change this dataStructure.h file. * * Author: RV + AL * Modified Date: July 2022 */ /* Data structure of "intArray_t" type that encapsulates our array of integers. */typedef struct { int* data; unsigned int size; unsigned int elementCount;} intArray_t; /* A type for returning status codes */typedef enum { INTARR_OK, INTARR_ERROR, INTARR_BADPARAM, INTARR_NOTFOUND} intArrayResult_t; /* * dataStructure.c * * Provides a bound-checked data structure made of…