owrreo TO), (2) er, and Then, create a “search()" function that can traverse through the binary search tree to find five values, 55, -25, 7, 47, and 22. If the value is found, display 1; otherwise, display 0. sample output looks: Developer... C:\csci133>ex12 55: 1 -25:1 67: 1 47: 0 22:0 storde X
Q: The circuit below depicts two NOR gates connected in a cascaded fashion. Complete the truth table…
A: The circuit below depicts two NOR gates connected in a cascaded fashion. This circuit is a…
Q: Network Infrastructure Design for a Community Center Background: The "Greenwood Community…
A: To design the simulated network for the Greenwood Community Center, here it can use Cisco Packet…
Q: • Fabrication Division: You've got that right. We're producing and selling at about 90% of our…
A: In the scenario outlined, the Fabrication Division of M4 Engineering and the Airplane Division are…
Q: Write a Java program that will allow the user to play a hangman game repeatedly until they choose to…
A: As per the given question, we need to implement the Hangman Game in Java.This implementation of the…
Q: Q1. A. Write a program in C++ that creates an array and asks the user to fill up the array with…
A: Q1 - A. Algorithm for Creating and Filling an Array with Strings:StartInitialize a constant for the…
Q: Which is a real-world analogy to a livelock? Two people standing in line at the grocery store. Two…
A: Livelock is a situation in computing where two or more processes continuously change their states in…
Q: Q2. Consider the following Floating-points in decimal: a) Fill the following table by computing the…
A: Considerd the following Floating-points in decimal:a = 125 * 10 ^ - 3b = 2.2 * 10 ^ 3 c = 0.000625 *…
Q: char buffer [BUFSIZE]; int fd = open("fooey",0_WRONLY|O_CREAT|O_TRUNC,0777); strcpy (buffer, "First…
A: seek(rfd, 130, SEEK_SET);read(rfd, buffer, 40);seek sets the file position to 130 bytes from the…
Q: Create a program that performs the following one-dimensional-array operations: Create an array…
A: Kindly note that I have used Java as the programming language, as there was no mention of…
Q: JAVA Language: Transpose Rotate. Question: Modify Transpose.encode() so that it uses a rotation…
A: The algorithm can be defined as Create an abstract classCreate two methods in classMake an object of…
Q: 6.4-1 Network- and Link-layer addressing: an end-to-end-scenario (1a). Consider the network shown…
A: A device must known the destination MAC address to communicate locally through media type like…
Q: how would you do this in a simple way? this is a non graded practice lab
A: The objective of the question is to create two classes, Tombstone and Cemetery, in Java. The…
Q: CASE BACKGROUND In 1983, MGMT eCash Inc. developed a type of cryptographic electronic currency,…
A: In this question we have to understand about the given scenario based of the company working on…
Q: SING C++, IN VISUAL STUDIOS, I NEED HELP WITH THIS. template class Dictionary (friend class…
A: In this question we have to write a C++ template class called Dictionary, which represents a basic…
Q: What is 5ED4 - 0694 when these values represent unsigned 16-bit hexadecimal numbers? The result…
A: The base-16 numeric system known as hexadecimal, or simply "hex," is often used.It employs sixteen…
Q: There are several parameters that impact the overall size of the page table. Listed below are key…
A: In computer operating systems, page tables are used as data structures to control the mapping…
Q: The question revolves around three cases, laws or regulations: Consumer Privacy Bill of rights,…
A: The objective of the question is to understand the three different cases, laws or regulations:…
Q: 2. Use RELATIONAL ALGEBRA to write the following queries: a) Find names and surnames of professors,…
A: In this question we have to understand about the schema provided to write a RELATIONAL ALGEBRA for…
Q: The built-in function eval takes a string and evaluates it using the Python interpreter. For…
A: Python is a general-purpose, interpreted, high-level programming language that is well-known for…
Q: Project: Blood Donation System The blood donation center is responsible for managing the donations…
A: Creating a complete set of diagrams and artifacts for a Blood Donation System requires significant…
Q: The concentration of E. coli bacteria in a swimming area of a lake is monitored after a rainstorm…
A: “Since you have posted a question with multiple sub parts, we will provide the solution only to the…
Q: In a livelock processes appear to be executing but without progress. True False
A: Livelock is a peculiar and challenging scenario in the realm of concurrent processing where active…
Q: JAVA Program modify this program below: take out while (true) { and use something else. Instead…
A: Main Program Logic:Employ a standard input mechanism for user interactions.Initiate an iterative…
Q: DESIGN or DRAW a high level “as-is” process diagram depicting how a trade would be made, under…
A: Process diagrams are used to visualize the processes or the nodes of a system, the links of the…
Q: : Consider the following Operator Grammar: E-> E + E|E*E| (E) | id Show the actions of Operator…
A: Operator precedence parsing is a method used to parse mathematical expressions based on the…
Q: The Horse table has the following columns: ID - integer, primary key RegisteredName -…
A: Table Description:The table Horse has the following columns:ID: An integer column serving as the…
Q: Choose three rulings, laws, or regulations that relate in some way to your use of the internet.…
A: Navigating the vast landscape of the internet involves adherence to various laws, regulations, and…
Q: 10.10 LAB: Quadratic formula Implement the quadratic_formula() function. The function takes 3…
A: The objective of the question is to create a Python program that calculates the solutions to a…
Q: The greatest common divisor (GCD) of a and b is the largest number that divides both of them with no…
A: The greatest common divisor (GCD) of two or more non-zero integers is the largest positive integer…
Q: I have tried to run the code, using the example usage as well and I get the error: "L is not a…
A: The provided Lisp code implements a solution to the Missionaries and Cannibals problem using a…
Q: Q4. Consider a paging system with the page table stored in memory. Answer and explain the following.…
A: Paging is a system for managing the memory resources in an operating system, which are used to…
Q: What is the effect of the instruction shown below? State your answer in English, something of the…
A: In the realm of x86-64 assembly language, instructions play a pivotal role in executing low-level…
Q: Please help me with this Operating Systems Principles homework: I need help with question 2. Q2
A: Banker's algorithm can be defined as the algorithm which is used to avoid deadlock and allocate…
Q: What are six examples of information technologies that could be used in computer crimes.
A: Computer crime, or cybercrime, refers to illicit activities executed through electronic means,…
Q: Let L = {binary strings that contain at least three 0's }. Give a ontext - free grammar that…
A: The task at hand involves defining a CFG for a specific language, denoted as L, which comprises…
Q: Provide an example of writing text output that uses two or more stream manipulators to format the…
A: Program output formatting may be customized using manipulators. It is helpful for C++ input and…
Q: how would you do this in a simple way? this is for a non graded practice lab
A: The objective of the question is to create a method in Java that removes all strings of a certain…
Q: Java How do I use printf to format this to money with .00 ? public static void main(String[]…
A: To format the output as money with .00 using printf in Java, you can use the %,.2f format specifier.…
Q: Discuss what you have learned about privacy, or the lack thereof, in today's technology. Is privacy…
A: In this question we have to understand about privacy, or the lack thereof.Is privacy at a…
Q: Could you explain what the R code is doing below? # read in each table read_counts <-…
A: In this question an R program is given that needs to be explained line by line.
Q: Problem 4: B-trees. In this problem the height of a tree is defined as the number of the nodes,…
A: This problem focuses on understanding and determining the smallest number of elements in a B-tree…
Q: What is the purpose of the exec system call?
A: The exec system call in Unix-like operating systems is a mechanism that replaces the current…
Q: Assume a 32-bit binary 01000101 01000101 01000011 01010011. Write down what value will the given…
A: In computer programming, an unsigned integer is a data type that represents entire numbers devoid of…
Q: Q5: Compute the run time of the following program Line No 1 2 3 4 56 Interpretation Initialization A…
A: The analysis of a given program, breaking down its instructions and computing essential metrics.…
Q: explain how Database Transaction Log Backups works as a backup?
A: Database Transaction Log Backups are quite important for maintaining data integrity and the…
Q: Within the tag, the code, , is used tell the browser what type of file it is and what type of…
A: Embed a Flash video using the <embed> tag. In this case, the type attribute is set to…
Q: Consider a database table named "EMPLOYEES" with the following columns: E_EMPLOYEEID, E_FIRSTNAME ,…
A: Understand the Requirement:Identify the table: In this case, the table is named "EMPLOYEES."Identify…
Q: What is self-emission in computer graphics aand visulization? What quailities does self-emission…
A: The objective of the question is to understand the concept of self-emission in the context of…
Q: In Python: The Broadway dataset contains data for Broadway shows' Capacity (percentage of the…
A: Algorithm: Broadway Dataset Processing and Visualization1. Start2. Prompt user to input the CSV file…
Q: Modify the code below: Add code to display both sum and diff in a hexadecimal format on the screen,…
A: To modify the code to display both the sum and difference in hexadecimal format with bytes stored in…
C++ code
Step by step
Solved in 5 steps with 2 images
- # define stemmer functionstemmer = SnowballStemmer('english') # tokenise datatokeniser = TreebankWordTokenizer()tokens = tokeniser.tokenize(data) # define lemmatiserlemmatizer = WordNetLemmatizer() # bag of wordsdef bag_of_words_count(words, word_dict={}): """ this function takes in a list of words and returns a dictionary with each word as a key, and the value represents the number of times that word appeared""" for word in words: if word in word_dict.keys(): word_dict[word] += 1 else: word_dict[word] = 1 return word_dict # remove stopwordstokens_less_stopwords = [word for word in tokens if word not in stopwords.words('english')] # create bag of wordsbag_of_words = bag_of_words_count(tokens_less_stopwords) Use the stemmer and lemmatizer functions (defined in the cells above) from the relevant library to find the stem and lemma of the nth word in the token list. Function Specifications: Should take a list as input and…Contact list: Binary Search A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Define and call the following function. The return value of FindContact is the index of the contact with the provided contact name. If the name is not found, the function should return -1 This function should use binary search. Modify the algorithm to output the count of how many comparisons using == with the contactName were performed during the search, before it returns the index (or -1). int FindContact(ContactInfo contacts[], int size, string contactName) Ex: If the input is: 3 Frank 867-5309 Joe 123-5432 Linda…def small_index(items: list[int]) -> int:"""Return the index of the first integer in items that is less than its index,or -1 if no such integer exists in items.>>> small_index([2, 5, 7, 99, 6])-1>>> small_index([-5, 8, 9, 16])0>>> small_index([5, 8, 9, 0, 1, 3])3"""
- Python write a program in python that plays the game of Hangman. When the user plays Hangman, the computer first selects a secret word at random from a list built into the program. The program then prints out a row of dashes asks the user to guess a letter. If the user guesses a letter that is in the word, the word is redisplayed with all instances of that letter shown in the correct positions, along with any letters correctly guessed on previous turns. If the letter does not appear in the word, the user is charged with an incorrect guess. The user keeps guessing letters until either: * the user has correctly guessed all the letters in the word or * the user has made eight incorrect guesses. one for each letter in the secret word and Hangman comes from the fact that incorrect guesses are recorded by drawing an evolving picture of the user being hanged at a scaffold. For each incorrect guess, a new part of a stick-figure body the head, then the body, then each arm, each leg, and finally…Creat a void fuction void myUpdate(string dictionary[], int wordCount, string oldWord, string newWord); Where it will replace the oldWord with the newWord, if the search is successful@6 The Reference-based Linked Lists: Select all of the following statements that are true. options: As a singly linked list's node references both its predecessor and its successor, it is easily possible to traverse such a list in both directions. According to the terminology introduced in class, the head reference variable in a singly linked list object references the list's first node. According to the terminology introduced in class, in a doubly linked list, each node references both the head and tail node. In a double-ended singly linked list, the tail reference variable provides access to the entire list. In a circular linked list, the last node references the first node.
- Task 5: Unscramble You will write a program that takes in 2 files: a dictionary file and a file listing jumbled words. Your binary will be called unscramble and will be run using unscramble The file contains a bunch of scrambled words, one word per line. Your job is to print out these jumbles words, 1 word to a line. After each jumbled word, print a list of real dictionary words that could be formed by unscrambling the jumbled word. The dictionary words that you have to choose from are in the file. As an example, the starter package contains two sample input files and the result should look as follows. The order that you display the dictionary words on each line can be different; however, the order that you print out the jumbled words should be identical to the order in your input. The sample out below is skipping a few lines to save handout space (your output must not omit these lines). nwae: wean anew wane eslyep: sleepy rpeoims: semipro imposer promise ettniner: renitent.…This is a linked list node class Node { public: int data; Node *next; }; Using the above code write the following functions. Please test in the main function of your program. Please upload all code that you write. 1. Adding and removing a node 2. Removing ever third node 3. Adding the complete list at the end. if you had a list 1,2,3 the new list will be 1,2,3,1,2,3 4. Write a function to find the average of the list 5. Write a function that takes in a list as a parameter and adds it to the current list. This Node add will only happen if list 1 element is less then list 2 element. Example List 1 - 1,2,3 List 2 - 3,1,4 New List - 4,2,7 - It only adds if L2 > L1 List all assumptions.public List<String> getLikes(String user) This will take a String representing a user (like “Mike”) and return a unique List containing all of the users that have liked the user “Mike.” public List<String> getLikedBy(String user) This will take a String representing a user (like “Tony”) and return a unique List containing each user that “Tony” has liked. create a Main to test your work. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.HashSet;import java.util.List;import java.util.Map;import java.util.Set; public class FacebookLikeManager { public List<String> facebookMap; private Set<String> likesSets; public FacebookLikeManager() { facebookMap = new ArrayList<>(); likesSets = new HashSet<>(Arrays.asList("Mike","Kristen","Bill","Sara")); } public void buildMap(String filePath) {…
- Counting hashtags Write Python code to count the frequency of hashtags in a twitter feed. Your code assumes a twitter feed variable tweets exists, which is a list of strings containing tweets. Each element of this list is a single tweet, stored as a string. For example, tweets may look like: tweets = ["Happy #IlliniFriday!", "It is a pretty campus, isn't it, #illini?", "Diving into the last weekend of winter break like... #ILLINI #JoinTheFight", "Are you wearing your Orange and Blue today, #Illini Nation?"] Your code should produce a sorted list of tuples stored in hashtag_counts, where each tuple looks like (hashtag, count), hashtag is a string and count is an integer. The list should be sorted by count in descending order, and if there are hashtags with identical counts, these should be sorted alphabetically, in ascending order, by hashtag. From the above example, our unsorted hashtag_counts might look like: [('#illini', 2), ('#jointhefight', 1),…yourList[8]. listi: 88888 Enter 5 integers: 9 8 After filling listi: 98756 list2: 98256 Enter 3 elements: 1 19 First three elements of listi: 1 2 3 list3: 00000000 list3: 7 0 54 8 15 88 8 Press any key to continue... program to test the class myArray. Should be gali. Not to copied one plz.Arithmetic progression def arithmetic_progression(items): An arithmetic progression is a numerical sequence so that the stride between each two consecutive elements is constant throughout the sequence. For example, [4, 8, 12, 16, 20] is an arithmetic progression of length 5, starting from the value 4 with a stride of 4. Given a non-empty list items of positive integers in strictly ascending order, find and return the longest arithmetic progression whose all values exist somewhere in that sequence. Return the answer as a tuple (start, stride, n) of the values that define the progression. To ensure unique results to facilitate automated testing, if there exist several progressions of the same length, this function should return the one with the lowest start. If several progressions of equal length emanate from the lowest start, return the progression with the smallest stride. items expected results [42] (42, 0, 1) [2, 4, 6, 7, 8, 12, 17] (2, 2, 4) [1, 2, 36, 49, 50, 70, 75, 98,…