Consider the list L, which is [11, 121, 1221, 12221, 122221, 1222221,...] where len (L) ==100. Without writing out the whole of L, write some python code to create L. If tab doesn't work on your browser, you can use spaces to indent. Enter your answer here
Q: Given a sentence, write a function that counts its number of words.
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT--------------
Q: Please send me answer within 10 min!! I will rate you good for sure!! Please send me typed answer!
A: For q1, I have provided C++ CODE along with CODE SCREENSHOT and OUTPUT…
Q: Full explain this question and text typing work only We should answer our question within 2…
A: Dear Student, The answer to your question is given below -
Q: report by: a. Computing and displaying the average price. b. Finding and displaying the day with the…
A: We need to read in an array and then use it to calculate the required values.
Q: Considering the significance of the network to the users' day-to-day activities, choose any three…
A: Introduction: These are the three: 1) dresolution rotosol (R) dresolution rotosol (R) dresolution…
Q: A frame of 1200 bytes travel through five switches along the path. Each link has a bandwidth of 100…
A: The system consists of 5 switches connected by 4 links, which are identical. Each link has bandwidth…
Q: Scrabble Scrabble is a game where players get points by spelling words. Words are scored by adding…
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: Write a function called word_jumble() that accepts a one word string from the user. The function…
A: Dear Student, The source code, implementation and expected output is given below -
Q: write a program that takes a string input from the user and calculates the sum of ASCII values of…
A: Step-1: StartStep-2: Declare variables sum_of_even_positions=0, sum_of_vowels=0Step-3: Declare…
Q: In C++ write a program for the following, don not use built in functions or any classes; Only use…
A: A Binary heap can be either a max heap or a min-heap.In min heap, the key at the root must be…
Q: An edge labeled with multiple symbols a, b,... → edge labeled with the symbol. Select one: O True O…
A: Here is the complete solution of the above problem. See below steps.
Q: e NOT true for a constructor? Select one: a. It does not return anything b. Every class must include…
A: Solution - In the given question , we have to select the incorrect statement for a constructor among…
Q: C++
A: Coded using C++.
Q: 2. Construct a context-free grammar G to accept the set of strings over the alphabet {(,)} that are…
A: If more than one tree is to be generated for the particular string then it is termed ambiguity in…
Q: What is the difference between bubble sort O(n2) time complexity and merge_sort O(nlog2n) time…
A: Big-O Complexity Analysis: It is a time analysis of an algorithm, program code block, and…
Q: How does the idea of "interdependence" differ from others when used to systems theory? We need some…
A: Interdependence is a characteristic of the global order that we live in today. Interdependence is…
Q: 6. Hashing Given a hash table with m = 11 entries and the following hash function h1 and step…
A: Chaining : In chaining, all the values having same hash function value are stored as a linked…
Q: Provide a brief rationale as to why you think this issue is important and critical to contemporary…
A: Answer:
Q: What is Brute Force algorithm? List two Pros and two Cons of using Brute Force. Apply the brute…
A: To define Brute Force algorithm And to apply the brute force algorithm to find the shortest path…
Q: In the following cipher a sender of a message has set randomly the cipher alphabet in order to…
A:
Q: rk with source s and t sink. We say that an edge e is a bottleneck if it crosses every…
A: observation as an s-t overflow network G= (V, E). Given font node s and sink node t, we can add…
Q: Create a javascript code, to ask user input the name, and print out 'Good A, name, welcome to…
A: The program is written in HTML, Javascript. Check the program screenshot for the correct…
Q: Write a script that: Deletes all previously created directories from C:\bkp\Firefox\ Writes the…
A: @echo off:: This script will dump the amount of memory used by firefox in firefox.txt file based on…
Q: Write a function so that the main() code below can be replaced by the simpler code that calls…
A: C++: C++ is a high level, general purpose programming language. It was developed by Bjarne…
Q: Main memory contains a total of 24 frames and each frame is 2³ bytes. How many bits are in the…
A: As per our company guidelines, only 3 sub parts will be answered. So, please repost the remaining…
Q: Define Prim's Algorithm and Kruskal's Algorithm. Are both algorithms same or different? Explain…
A: INTRODUCTION: Kruskal's Algorithm: Prim's method is a well-known example of a greedy algorithm. It…
Q: In the Media Posts worksheet, in column G of the Facebook table, apply the VLOOKUP function to…
A: Here we have to apply VLOOKUP function to categories the size of each post the syntax of VLOOKUP is…
Q: (62) 10=( )2=( )8=( )16
A: (62)10 = ( ? )2 = ( ? )8 = ( ? )16
Q: Algorithm 1: Question 2.1 1 numbers [1,2,3,4,5); 2 stack-new Stack(); 3 queue = new Queue(); 4…
A: Required: Algorithm 1: Question 2.1 number = [1, 2, 3, 4, 5]; stack = new Stack(); queue = new…
Q: Write the configurations that the below Turing machine enters for the input string 11. 91 1a, R R 1…
A: An abstract machine that manipulates symbols on a strip of tape in accordance with a set of rules is…
Q: Exercise :: design a V.B project with the following steps; a. Change the Color of the text box to…
A: VB.Net which refers to the one that the VB.NET is a programming language are designed to create…
Q: Question 6 sm .use Java create a GUI sketch for gym membership program and a brief description of…
A: GUI Sketch: Title: Gym Membership Program Components: 1. Text Field: enter your name 2. Text…
Q: Identify and briefly explain a variety of difficulties facing the world's information systems.
A: A system for gathering, storing, and analyzing data and providing information, knowledge, and…
Q: Write a section of Python code (not an entire function) that adds up the even numbers from 2 through…
A: Step-1: Start Step-2: declare variable x and assign value 2Step-3: declare variable total and assign…
Q: Write a function that takes as inputs the 3 sides of a triangle and returns true if it is a right…
A: algorithm:- bool checkTriangle(int p,int b,int h) if h*h==p*p+b*b return true else…
Q: How does Virtualization help facilitate the development of Open-Source Software?
A: Introduction: Open-source software development is the process through which an open-source software…
Q: Complete a program that reads a vector index as input and outputs the element of a vector of 10…
A: Please find the answer below :
Q: Given a time in 12-hour notation, write a function that displays it in 24-hour notation.
A: In this question we have to write a function in programming language which converts the time in…
Q: IN PYTHON* The file words.txt contains a long list of words, with one word per line. We want a…
A: we need to write a Python program that will read the words, sort them, and write the sorted words…
Q: Assume a relation schema R(a, b, c, d, e, f) with primary key (a, b) and the following full func-…
A: Functional Dependencies:- Functional dependencies are the result of the interrelationship between…
Q: How do you recognize the attitude of somebody towards something? FoxFirst wants to identify the…
A: The way you think and feel about someone or something; the way you treat someone or something that…
Q: ed as follows: • If the user wins, the user gets 2x the bet. • Otherwise, the user loses the bet.…
A: Dear Student, The source code, implementation and expected output is given below -
Q: Prove that when doing depth-first search on undirected graphs there are never any forward or cross…
A: Depth-first search Depth-first search, or DFS, is a way to traverse the graph. Initially it allows…
Q: Give an example of a graph that has all 3 of the following properties. (Note that you need to give a…
A: Explanation: It is connected It has one articulation point that is node The graph needs at least 4…
Q: Assuming a scanner variable has been initialized. To read an entire line of input into a string we…
A: Input Statements: Java use the different ways to read the different datatype elements. First of all…
Q: Given the importance of the network to daily operations, name three protocols that might be…
A: Protocol for Address Resolution 1. (ARP): Using a communication layer protocol, which maps between…
Q: If a class is only ever instantiated as part of the constructor of another class, what is the most…
A: Please refer to the following step for the complete solution to the problem above.
Q: Question 40 The 8051 has two 16-bit timers. The high byte for timer one is at address 1) 7DH 2) 8DH…
A: Timer/counters in 8051 The two timers T0 and T1 on the 8051 can be set and utilized separately.…
Q: Discrete Math, please explain There are three red balls, six blue balls, and ten white…
A: Given 3 red balls, 6 blue balls, and 10 white balls, we need to find number of ways to choose eight…
Q: Using the Celsius ToKelvin function as a guide, create a new function, changing the name to…
A: C++ (or “C-plus-plus”) which refers to the one it is referred as the object oriented programming…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- In this assignment, you will compare the performance of ArrayList and LinkedList. More specifically, your program should measure the time to “get” and “insert” an element in an ArrayList and a LinkedList.You program should 1. Initializei. create an ArrayList of Integers and populate it with 100,000 random numbersii. create a LinkedList of Integers and populate it with 100,000 random numbers2. Measure and print the total time it takes to i. get 100,000 numbers at random positions from the ArrayList 3. Measure and print the total time it takes to i. get 100,000 numbers at random positions from the LinkedList 4. Measure and print the total time it takes to i. insert 100,000 numbers in the beginning of the ArrayList 5. Measure and print the total time it takes to i. insert 100,000 numbers in the beginning of the LinkedList 6. You must print the time in milliseconds (1 millisecond is 1/1000000 second).A sample run will be like this:Time for get in ArrayList(ms): 1Time for get in…Write a Java application CountryList. In the main method, do the following:1. Create an array list of Strings called countries.2. Add "Canada", "India", "Mexico", "Peru" in that order.3. Use the enhanced for loop to print all countries in the array list, one per line.4. Add "Spain" at index 15. Replace the element at index 2 with "Vietnam". You must use the set method.6. Replace the next to the last element with "Brazil". You must use the set method. You willlose one point if you use 3 in the set method. Do this in a manner that would replace thenext to the last element, no matter the size of the array list.7. Remove the object "Canada" Do not remove at an index. Your code should work if"Canada" was at a different location. There is a version of remove method that willremove a specific object.8. Get and print the first element followed by "***"9. Call method toString() on countries to print all elements on one line.10. Use the enhanced for loop to print all countries in the array list,…Java Create an ArrayList of strings to store the names of celebrities or athletes. Add five names to the list. Process the list with a for loop and the get() method to display the names, one name per line. Pass the list to a void method. Inside the method, Insert another name at index 2 and remove the name at index 4. Use a foreach loop to display the arraylist again, all names on one line separated by asterisks. After the method call in main, create an iterator for the arraylist and use it to display the list one more time. See Sample Output. SAMPLE OUTPUT Here is the list Lionel Messi Drake Adele Dwayne Johnson Beyonce Here is the new list * Lionel Messi * Drake * Taylor Swift * Adele * Beyonce Using an iterator, here is the list Lionel Messi Drake Taylor Swift Adele Beyonce
- Modify the algorithm described in the class to calculate the longest palindrome, such that there is enough information on the table to build the longest palindrome from the table. Hint: You can use similar data structure used for Longest common subsequence. Explain how you can rebuild a longest palindrome from the given string using this data structure.You can plot shapes in Python using line graphs in matplot lib by providing the coordinates of the vertices of the shapes as x, y pairs and using the matplotlib.pyplot.plot (i.e. plt.plot) function. Draw a triangle, square, pentagon, hexagon and heptagon. Note: Use symmetry, starting with the origin at (0,0), and set the distance from the origin to the vertex to be of length 1.0 (otherwise this becomes very complicated for some shapes).Write a program that prompts the user to enter the coordinates of six points and fills the polygon that connects the points, as shown in Figure 11.16a. Note that you can draw a polygon using canvas.create_polygon(points), where points is a two-dimensional list that stores the x- and y-coordinates of the points.
- In JAVA, use a HashMap to count and store the frequency counts for all the words from a large text document. Using file util, please. Then, display the contents of this HashMap with words and frequency count. Next, please create a set view of the Map and store the contents in an array. Sort this array based on key value and display it. Finally, sort the array in decreasing order by frequency and display it as well. Please label your explanation in the code Thank youCreate an ArrayList of strings to store the names of celebrities or athletes. Add five names to the list. Process the list with a for loop and the get() method to display the names, one name per line. Pass the list to a void method. Inside the method, Insert another name at index 2 and remove the name at index 4. Use a foreach loop to display the arraylist again, all names on one line separated by asterisks. After the method call in main, create an iterator for the arraylist and use it to display the list one more time. See Sample Output. SAMPLE OUTPUT Here is the list Lionel Messi Drake Adele Dwayne Johnson Beyonce Here is the new list * Lionel Messi * Drake * Taylor Swift * Adele * Beyonce Using an iterator, here is the list Lionel Messi Drake Taylor Swift Adele Beyonce Textbook: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th Author: Y. Daniel Liang Publisher: Pearson ISBN: 9780134670942Create an ArrayList of strings to store the names of celebrities or athletes. Add five names to the list. Process the list with a for loop and the get() method to display the names, one name per line. Pass the list to a void method. Inside the method, Insert another name at index 2 and remove the name at index 4. Use a foreach loop to display the arraylist again, all names on one line separated by asterisks. After the method call in main, create an iterator for the arraylist and use it to display the list one more time.
- java Write a program to do the following: Create an ArrayList of Student. Add 7 elements to the ArrayList. Use for each loop to print all the elements of an ArrayList. Remove an element from an ArrayList using the index number. Remove the element from an ArrayList using the content (element name).Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print: 7 9 11 10 10 11 9 7 Hint: Use two for loops. Second loop starts with i = courseGrades.length - 1. import java.util.Scanner; public class CourseGradePrinter {public static void main (String [ ] args) {Scanner scnr = new Scanner(System.in);final int NUM_VALS = 4;int [ ] courseGrades = new int[NUM_VALS];int i; for (i = 0; i < courseGrades.length; ++i) {courseGrades[i] = scnr.nextInt();} /* Your solution goes here */ }}There are two different methods you to add a range to an ArrayList.These methods are AddRange and InsertRange.implement a c# program to demonstrates how these two methods are used: