Using a binary search tree, store the words and keep count of number of occurrences per word. The main function should call on other functions to complete these tasks ("Insert" "Count" etc.).
Q: Write a program to accept radius of the circle from the user and display its area?
A: We need to write a program that accepts radius of the circle from the user and prints the area of th...
Q: |Question:: Write a loop to display the powers of 2 exactly as shown below: 4 16 32 64 128
A: Start Take the number of terms Find the powers of 2 Compute results Print Stop
Q: What are the three options available in Insert >> Picture menu?
A: The Correct answer is : Option a)Clipart, From Files, AutoShapes Insert Page Layout Picture Clip Cli...
Q: What Is SDLC?
A: SDLC stands for Software Development Life Cycle. It contains many models and the examples of models ...
Q: What was the overall impact of the Capital One breach? Is it possible that this might have been avoi...
A: The Capital One breach involved sensitive data that was stored in the financial institution’s AWS de...
Q: Develop a program in Java to demonstrate the operations of Leftist Heap. The menu should contain fo...
A: Develop a program in Java to demonstrate the operations of Leftist Heap. The menu should contain ...
Q: Which firewall security strategy would be the best solution for the scenario? Why?
A: Introduction: Here we are required to provide the best security strategy that would be best for the ...
Q: Question:: Write a loop to display the powers of 2 exactly as shown below: 4 16 32 64 128 12
A: As per answering guidelines since no language is mentioned using c++ language.
Q: Give an example of a word then define and describe it in a well-explained manner, prefereably paragp...
A: Answer: 1. Define: Definition- To determine or identify the essential characteristics or meaning of ...
Q: Item 14: An IPV4 address is often written in decimal. Each octet cal O and 255. What is incorrect ab...
A: Find the answer below of above query. I hope this will meet your requirements.
Q: Create a ladder program that will have the following results: a. Lamp L2 and Lamp L3 deactivated wh...
A: As the specification mentioned in the question, here is the required java code. import java.uti...
Q: What distinguishes multicore architecture from other architectures?
A: Introduction: A multicore architecture is one in which a single physical processor contains the core...
Q: Why is it important to assess and mitigate the exposure and vulnerability of a community?
A: Why is it important to assess and mitigate the exposure and vulnerability of a community?
Q: Use the below description of a Car Club System (CCS) to answer the following questions. A Car Club ...
A: Functional Requirements are the type of requirements that tells about what system has to do. These r...
Q: How do you transform an analog signal to digital?
A: Analog to digital signal can be transform using technique called pulse code modulation that is PCM.
Q: i am getting whitespace error on output : I-290 is auxiliary, serving I- 90 going east/west. it s...
A: Summary after fixing the code, I have provided PYTHON CODE along with SCREENSHOT OF CODE ...
Q: P and Q are two processes that share a set of variables that is common. The variable includes: seq, ...
A: Here either of the process can execute first. Also a process can be preempted by another process. T...
Q: n today's environment, big data has become an integral aspect of any organization's information tech...
A: Introduction: IT systems, which include computer programmes, software, databases, and related docume...
Q: In javascript I need help creating a web page that has the following elements: You must use the fol...
A: In javascript I need help creating a web page that has the following elements: You must use the fol...
Q: What will be the impact of the internet of things (IoT) on our everyday lives? Justify your position...
A: According to the information given:- We have to define the internet of things on our everyday lives ...
Q: In a Layer 1 frame, what information is normally provided?
A: Answer: In the OSI reference model, there is seven-layer. 1. Physical Layer 2. Data Link Layer 3. N...
Q: You need to know how to add an item to an existing binary search tree
A: Insertion is used to add new value in a binary search tree at correct location. Insertion follow the...
Q: JAVA QUESTIONS Write a Java program to get the nth catlan number Take the n from the user.
A: Required:- JAVA QUESTIONSWrite a Java program to get the nth Catalan numberTake the n from the use...
Q: Configure the OSPF process on all routers for a single area-0 (backbone) and advertise its directly ...
A: Introduction: Open Shortest Path First (OSPF) is an IP network link-state routing protocol that is b...
Q: counterexample for each. a) Let LO be an arbitrary language and L1 regular such that LO .L1 is regul...
A: Summary: - Hence, we have discussed all the points.
Q: Regardless of how user level threads are implemented, if a programme has two or more user level thre...
A: Introduction: Kernel: A kernel is the heart of a computer's software or operating system. Provide a ...
Q: P and Q are two processes that share a set of variables that is common. The variable includes: seq, ...
A: The answer is given below:-
Q: 2 Using Divide and Conquer technique, sort the given number using quick sort 9,1,3,5,2,6,4
A: quickSort(arr[], low, high) { if (low < high) { /* pi is partitioning index, arr[...
Q: Display the reversion (also called vision) of the operating system.
A: So you ran : "cat/etc/os-release" ? This is wrong command. The corrent command to get the Operating ...
Q: 1. Consider the Case study and answer the question below. Scenario: The Ministry of Health is planni...
A: Given The answer is given below.
Q: If you wanted to know the position of the letter v (i.e. return 2) in the String str containing the ...
A: A String is a pre defined class in Java which has various methods in it to perform the operations on...
Q: EMPLOYEE (EmplD, LName, MName, FName, Phone, HireDate, MgrNum, EType) HOUSEKEEPER (HKID, Shift, Stat...
A:
Q: Using Divide and Conquer technique, sort the given number using quick sort 9,1,3,5,2,6,4
A: Comparison based sorting is a kind of sorting, in which, in order to find the Sorted array, the elem...
Q: A certain store sells softdrinks for P6.00 and sanwiches for P6.50. Draw the flowchart to input the ...
A: A flowchart is an image of the different strides of a cycle in consecutive requests. A conventional ...
Q: rrange the following list of elements in ascending order using heap sort: 9, 3, 5, 27, 4, 67, 18, 3...
A: The heap sort is often a comparison-based sorting method that uses the Binary Heap data structure. T...
Q: Write a program in java to input ‘+’ ,’-‘ , ‘*’ , ’/’ and two integers. Depending upon the symbols ...
A: We need to write a Java program to take input of '+', '-', '*', '/' and two integers. Then we need t...
Q: What is the systems development life cycle (SDLC)?
A: Here is the detailed explanation of the solution
Q: Two stacks of positive integers are needed, one containing elements with values less than or equal t...
A: We can solve this problem by using an integer array of size 200 (it is mentioned that at a given tim...
Q: Decrite how web caching Can reduce delary in recimng a reguested btject
A: Web caching is a process of storing the data for reuse, such as a copy of a web page served by the w...
Q: LANGUAGE TO USE C SHARP AND CODE MUST COMPILE IN VISUAL STUDIO. ------------------------------QUE...
A: According to the information given:- We have to follow the instruction mentioned to get the desired ...
Q: What will be the impact of the internet of things (IoT) on our everyday lives? Justify your position...
A: Introduction: IoT is a network of networked, internet-connected devices that can gather and transmit...
Q: Analyze the process to convert the floating point to binary number. Assume FIVE (5) bits for the neg...
A: Here take a simple floating number , to convert into binary: =======================================...
Q: write a c++ program that output the letter "Z" 360 degrees clockwise
A: Step 1 Java Code Java Code to print Z and rotate it by 360 degree clockwise. import java.util.Scanne...
Q: The variable for level should be of int type. The bonus attack speed % should be converted to decima...
A: We need to create a Program that computes the current attack speed at a certain level. We need to ta...
Q: What actions should a company take to discourage employees from breaking company rules or committing...
A: Introduction: Evidence demonstrating a history of Prohibited Conduct by both the Respondent followin...
Q: Write a program named pl that converts a gray-level image to a binary one using a threshold value: p...
A:
Q: Regardless of how user level threads are implemented, if a programme has two or more user level thre...
A: Introduction: Here we are asked that the given statement about user level thread is true or false.
Q: Using ANN code, investigate the influence of the number of hidden layers from 1-3 on F-score. Each h...
A: You need to use Cross-validation to test the accuracy on the test set. The optimal number of hidden ...
Q: Two stacks of positive integers are needed, one containing elements with values less than or equal t...
A: The answer is given below:-
Q: What is the definition of IP spoofing? Is IP spoofing regarded as a security risk?
A: Introduction: Spoofing is a type of cyber-attack in which hackers gain access to systems in order to...
** Using C
Read a text file called "words.txt" containing: "Cat goose dog mouse cow dog goose goose"
Using a binary search tree, store the words and keep count of number of occurrences per word. The main function should call on other functions to complete these tasks ("Insert" "Count" etc.).
Print the words and occurrences per word in the output, in alphabetical order. For example:
"Cat 1
cow 1
dog 2
goose 3
mouse 1"
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Part I: Define a “word” as a maximal length sequence of alphanumerics. For example, in the line Hello, there! How are you? I am fine; how are you? My number is DE4-3656. the words are “hello”, “there”, “How”, “are”, “you”, “I” “am”, “fine”, “how”, “are”, “you”, “My”, “number”, “is”, “DE4”, and “3646”. Write a C program that reads lines from a file (you may assume it’s a text file) or files named on the command line, breaks them into words, stores the words in order (that is, ASCII order), and counts the number of times each word appears. Do not make any assumptions about the number of lines or words; but you may assume no word is over 256 characters long. When this is done, print the words and counts, as follows. This example is from the line above: 3646 (1) DE4 (1) Hello (1) How (1) I (1) My (1) am (1) are (2) fine (1) how (1) is (1) number (1) there (1) you (2) Call your file wordsort1.c. Hint: This is easiest done using a linked list, with each element a structure containing…6.28 In Python, Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique. END WITH A NEW LINE6.28 In Python, Write a program that replaces words in a sentence. The input begins with word replacement pairs (original and replacement). The next line of input is the sentence where any word on the original list is replaced. Ex: If the input is: automobile car manufacturer maker children kids The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique.
- 5.18 C++ Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one. Ex: If the input is: 5 2 4 6 8 10 the output is: 10,8,6,4,2,Write keyword-counting program with the definition of keytab. Themain routine reads the input by repeatedly calling a function getword thatfetches one word at a time. Each word is looked up in keytab with a versionof the binary search function. The list of keywords must be sorted in increasing order in the table.Python Code Help Consider the following function and attempted body.""" from typing import TextIO def allergy_checker(shopping_lists: TextIO, clean_shopping_lists: TextIO, allergies: list[str]) -> None: ''' shopping_lists is a file open for reading that has at least one food name on every non-blank line. Food names are separated by a space. Each line in shopping_lists ends with a newline character. clean_shopping_lists is a file open for writing. allergies is a list of one-word food names. Copy lines from shopping_lists to clean_shopping_lists. For each food name that is in the allergies list, replace it with 'REMOVED'. If a blank line in shopping_lists is reached, stop reading the file. ''' shopping_lists = open(shopping_lists) # Line 1 clean_shopping_lists = open(clean_shopping_lists, 'w') # Line 2 line = shopping_lists.readline() # Line 3 while line.strip(): # Line 4 line = shopping_lists.readline() #…
- Using the following instruction below, write a header class for orderedLinkedList with a function of search,insert, insertFirst, insertLast and deleteNode. Use the library to write a c++ program to show an operation on an ordered linked list. - include the orderedLinkedList.h library in the codes - Create main function and include your information details - initialize a list1 and list2 as orderedLinkedList type - Declare a variable num as integer data type - Print out an instruction for user to input a numbers ending with -1 - Get a numbers from user input - Use a while loop to insert the numbers into list1 ending with -1 - Assign the list2 to list1 - Print out the current elements in List 1 and 2 - Get user input for the number to be deleted - Delete the number requested by user in list2 - Print out the elements in the list1 and list2 after delete operationThe following Python code is a partially written function that attempts to read a file's contents into a dictionary. Fill in the missing code in the make_dictionary function. You do not need to copy any of the existing code. Just write the code that would go in place of "YOUR CODE HERE". def make_dictionary(filename):'''Function -- make_dictionaryCreates a dictionary from a file's contents. Each line in the file is split into a list at commas.If, after splitting, the list contains exactly 2 parts,the first item is added to the dictionary as a keyand the second item is the value. If the providedfile doesn't exist, the message "File doesn'texist" is printed to the terminal and anempty dictionary is returned.Parameter:filename -- The name of the file to open.Returns:A dictionary of the file's contents, if thefile matches the expected format. Otherwise, anempty dictionary is returned.'''contents = {}# YOUR CODE HEREreturn contents Example If the contents of the file passed to the function…Create a file called search_replace.py. Here, create a program thatimplements a search and replace function recursively. Your programshould allow a user to enter a string, a substring they wish to find andanother string with which they wish to replace the found substring. Consider finding the index of the string you want replace then use concatenation and slicing to join the different parts togetherThe output of your program should be similar to the output given below:Please enter a string: Hello worldPlease enter the substring you wish to find: lloPlease enter a string to replace the given substring: @@Your new string is: he@@ world
- Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ... # Put your code here import os #module used to interact with operating system def displayFiles(pathname): #recursive function that takes a pathname as argument if (os.path.isdir(pathname)): #checks if specified path (argument) is an existing directory #for item in os.listdir(pathname): for content in os.listdir(pathname): #gets the list of all files and directories in the directory and…Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file or the name of a directory. If the pathname refers to a file, its filepath is displayed, followed by its contents, like so: File name: file_path Lorem ipsum dolor sit amet, consectetur adipiscing elit... Otherwise, if the pathname refers to a directory, the function is applied to each name in the directory, like so: Directory name: directory_path File name: file_path1 Lorem ipsum dolor sit amet... File name: file_path2 Lorem ipsum dolor sit amet... ...1. Given two .txt files that have lists of numbers in them, find the numbers that areoverlapping (print them in the output). “primenumbers.txt” has a list of all primenumbers under 1000, and the other “happynumbers.txt” has a list of happy numbersup to 1000.We can divide this problem into different parts:a. Write a function (call it readFile) that takes the name of a file as argument and read the content of the file and store it in a list (each line contains onenumber, so each number is stored in the list) and return the list.b. Write a function that takes two lists and return another list containing thecommon elements of two lists (you have written this function before! You canuse it)c. Write a function (call it writeFile) that takes a list and name of a file. The function should write the content of the list in the file (each element in oneline).d. Use the above functions to do the task of this lab.