Complete the get_2_dimensional_list() function that takes two parameters: 1. An integer num_rows. 2. An integer num_columns. The function should return a 20 list with num_rows rows and num_columns columns. Each element is set to a random value between 1 and 99 included. If both parameters num_rows and num_columns are set 0, the function returns an empty list You MUST use a for..in...range loop to create the 2D list. You do not need to import the random module as it has already been done for you. Some examples of the function being called are shown below. For example: Test random.seed(15) num_columns - 5 matrix get 2 dimensional_list(num_rows, num_columns) print(matrix) random.seed (132) num_rows=2 num_columns 2 matrix get 2 dimensional_list(num_rows, num_columns) print(matrix) Result [[27, 2, 67, 95, 5], [21, 31, 3, 8, 86]] [[53, 20], [53, 8]]
Q: What information is used by a standard packet-filtering router? What are the weaknesses of a…
A: Packet filtering is a process of forwarding or blocking packets on a network interface based on…
Q: Recursive resolvers will only make a single request to a server, expecting the complete answer back…
A: False. Recursive resolvers will make multiple requests to different servers in order to resolve a…
Q: Based on the technique used to determine incursions, IDPSs fall into one of two categories.
A: Networks that monitors network traffic for suspicious behavior, pre-analyzes it, and issues warnings…
Q: d keeping a diverse staff, what obstacles does your organization face? Justify your reasoning as you…
A: A diverse workplace can also foster a stronger sense of belonging among people in traditionally…
Q: a. How many subnets are there in this network? b. What are the first valid host and last valid host…
A: The answer is
Q: Give directions on how to properly store data and do preventive maintenance on computers to ensure…
A: While data loss may seem inevitable, you can prevent data loss with the right precautions and…
Q: Does it make a difference if you think about how a firm is set up and what it does? What…
A: The following five elements are the most frequent, while there are many more aspects that might…
Q: Can you explain what a Domain Name System (DNS) is and how it works?
A: Describe DNS. 1) The Domain Name System (DNS) is the Internet's phone book. 2) We use domain names,…
Q: Propose a Big Data Architecture for a company that provides flight tracking information to its…
A: Introduction : Big data is a term used to describe the large volume of data that organizations…
Q: What are the distinctions between Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP),…
A: Introduction SMTP covers the process of sending messages using SMTP (from the e-mail client of the…
Q: In a classroom with students of varying ages, what role does Microsoft Office play?
A: The solution is given in the below step
Q: A DMA module is transferring characters to main memory from an external device transmitting at 9600…
A: Given: DMA transfer speed = 9600 bpsCPU fetching speed= 1 million instruction per second To find:…
Q: I was wondering how difficult it was to set up a network for the whole firm. Describe the problems…
A: Introduction: An enterprise-wide network connects computers in various buildings or cities.…
Q: What techniques may managers use to improve the comparability and accessibility of performance…
A: What techniques may managers use to improve the comparability and accessibility of performance…
Q: Entries in the access control list explicitly allow or deny what? Group of answer choices access to…
A: Please refer to the following step for the complete solution to the problem above.
Q: Is there a bright future ahead for those who work in casino operations management?
A: Introduction: Here, we must describe the future state of the casino operations management sector.
Q: It's important to understand what causes hash table collisions so that we can avoid them. Please…
A: Hash table collision Hash table collisions occur when two or more keys are mapped to the same index…
Q: r of nodes in the shortest linked list. Do
A: SummaryConsider the following shape. It's a representation of a collection of elements, not a shape.…
Q: When planning for data backup and restoration, it's important to consider every possible scenario.
A: When planning for data backup and restoration, it's important to consider multiple scenarios to…
Q: Please explain the main differences between synchronous and asynchronous forms of interaction.
A: Synchronous and asynchronous are two popular forms of communication for a remote team. Synchronous…
Q: During the process of DBMS query optimization, please describe how each of the eight cost estimating…
A: DBMS, or database management system: A software called a database management system (DBMS) is used…
Q: def solution(a, b): common = [] a.sort() b.sort() for num_a in a: for num_b in b: def main(): if…
A: Answer: We need to write the what is the time complexity for this algorithms So we will see in the…
Q: How can the three different types of job analysis—requirements-based, competency-based, and job…
A: These are the three types of job analysis where analysis are done to check the requirements.
Q: Define a named tuple Player that describes an athlete on a sports team. Include the fields name,…
A:
Q: The following are the variables that impact the Big-O performance of a hash table, listed from most…
A: The following are the key factors that determine a hash table's Big-O performance: INTRODUCTION : A…
Q: used for the majority of onlin
A: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are both transport layer…
Q: We have a crude hash map where all values are concatenated into a single bucket (that is, they are…
A: Introduction: Hash tables are groups of arranged things that make it possible for them to be readily…
Q: In other words, what exactly is a system model? What criteria should guide the construction of the…
A: Modeling a system The interdisciplinary study of using models to imagine and create systems in the…
Q: Gentoo and its attributes should be described in the context of server operating systems.
A: Gentoo is an operating system based on FreeBSD. Its popularity is due to the fact that it supports…
Q: To what two kind of technology do the great majority of wireless networks resort?
A: Which two types of technology are used in the majority of wireless networks? Consequently, it is…
Q: Explain how each of the eight potential cost estimation strategies may be combined with different…
A: Choosing the most effective and economical way to conduct relational algebra operations is the…
Q: How does object-oriented programming, or OOP, really work? The benefits of object-oriented…
A: Introduction Object-oriented programming," or OOP, alludes to programming dialects that utilize…
Q: The execution of instruction set architecture is an excellent illustration of the use of abstraction…
A: Introduction: A technique for obscuring unimportant details and focusing on the most important…
Q: Write a java set of classes that could be used to do simple calculations on geometric objects. The…
A: Algorithm: Step 1 Start Step 2 Create an abstract class named Shapes that contains two abstract…
Q: Please explain in detail what the Dynamic Host Configuration Protocol (DHCP) is and how it works.
A: This protocol is also known by its acronym, DHCP, which stands for Dynamic Host Configuration…
Q: Does an m-size hash table always include the same amount of linked lists? To me, a hash function…
A: Answer: We need to wrote the how does the m-size hash table always include the same amount of linked…
Q: IT (information technology) (information technology) Is technology helpful in the classroom, the…
A: 1. When we hear the term, we frequently think of communications innovations Or we conjure up visions…
Q: One of the components of a composite primary key might be a candidate key. What would you do if you…
A: Composite primary key is a combination of multiple columns and these columns are used to identify…
Q: Explain how OpenCL achieves parallelism by use of the work-item and enqueueNDrange.
A: OpenCL Models: Device Model: This model explains how the interior of the device appears. Execution…
Q: Explain the pros and cons of utilizing the three most common types of networks.
A: Introduction: In a computer network, two or more computers are linked together and share resources,…
Q: What is the Domain Name System (DNS), and how does it function? Please provide a detailed,…
A: A hierarchical, decentralised naming system for resources connected to the Internet or a private…
Q: There is no comparison between a mainframe and a laptop when it comes to operating systems. Is there…
A: Operating System: The software that controls how the computer works is called the operating system.…
Q: Exactly how many distinct types of semaphores exist? Give some applications of it.
A: Introduction: Semaphores are integer variables that are used to solve the critical section problem…
Q: Employee pay and other sensitive data must be kept secure while yet being available to management.
A: The manager is in charge of overseeing all aspects of the business and managing it as a whole. The…
Q: Initialize the tuple team_names with the strings 'Rockets', 'Raptors', 'Warriors', and 'Celtics'…
A: Let's first understand what is the Tuple in programming . Every programming language consist of the…
Q: How does the synchronous real-time paradigm differ from its contemporaries?
A: A Real-time System is a system that is utilized for the process of carrying out various distinct…
Q: What makes proficiency in spreadsheets so important for today's workers, anyway? Please provide two…
A: Spreadsheets are the 2nd most-used business requirement behind email, and with good reason. Excel,…
Q: iven the unsorted list S: 14, 26, 24, 26, 26, 29, 37, 35, 40, 10, 2, 7, 4, 12, 15, 15, 17,37,7,…
A: To divide the given unsorted list S into groups in the order that items are given, we can use a…
Q: Can you see an advantage to learning how to use computers? How, exactly, does technology improve…
A: Introduction: Programmable computers store, retrieve, and process data. The term was used to…
Q: May you give me a more in-depth breakdown of how deep learning could be used in the IoT?
A: The answer to the question is given below:
Python
Step by step
Solved in 4 steps with 2 images
- Implement the function below void swap(int pos1, int pos2) {} For LinkedList, to maintain integrity of data in the structure, you are not to swap directly the element, nor remove a node. Instead, you are to only change the nodes' next pointers. Inital code to be completed: class LinkedList : public List { node* head; node* tail; int index; node* create_node(int num) { node* n = (node*) malloc(sizeof(node)); n->element = num; n->next = NULL; return n; } public: LinkedList() { index = 0; head = NULL; tail = NULL; } int add(int num) { addTail(num); return index; } int get(int pos) { node* currnode = head; int count =0; while (currnode != NULL){ count++; if (count == pos){ return currnode -> element; }else{ currnode = currnode -> next; } }…You are given the pointer to the head node of a linked list and an integer to add to the list. Create a new node with the given integer. Insert this node at the tail of the linked list and return the head node of the linked list formed after inserting this new node. The given head pointer may be null, meaning that the initial list is empty. Function Description Complete the insertNodeAtTail function in the editor below. insertNodeAtTail has the following parameters: SinglyLinkedListNode pointer head: a reference to the head of a list int data: the data value for the node to insert Returns SinglyLinkedListNode pointer: reference to the head of the modified linked list Input Format The first line contains an integer , the number of elements in the linked list.The next lines contain an integer each, the value that needs to be inserted at tail. Constraints Sample Input STDIN Function ----- -------- 5 size of linked list n = 5 141 linked list data values…Use the Design Recipe to write a function, count_odds, that consumes a list and two integers, lower_bound and upper_bound, and returns the number of all the odd integers in the list that are between lower_bound and upper_bound (inclusive of both lower_bound and upper_bound). Include a docstring!
- Complete the docstring below, and use the helper functions attached if necessary: def check_syllable_counts(poem_lines: POEM, description: POETRY_FORM_DESCRIPTION, word_to_phonemes: PRONUNCIATION_DICT) \ -> List[POEM_LINE]: """Return a list of lines from poem_lines that do NOT have the right number of syllables as specified by the poetry form description, according to the pronunciation dictionary word_to_phonemes. If all lines have the right number of syllables, return the empty list. Precondition: len(poem_lines) == len(description[0]) >>> poem_lines = ['The first line leads off,', ... 'With a gap before the next.', 'Then the poem ends.'] >>> description = ((5, 5, 4), ('*', '*', '*')) >>> word_to_phonemes = {'NEXT': ('N', 'EH1', 'K', 'S', 'T'), ... 'GAP': ('G', 'AE1', 'P'), ... 'BEFORE': ('B', 'IH0', 'F',…Write a function called list_to_dict(lst) that takes a 2-D list of sales records of this form.[["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75]]Your function will store the sales information in a dictionary, where each {key:value} pair of the dictionary stores {a unique customer: [ a list of all products purchased by this customer, total cost of these products]}, and returns the dictionary. Sample run,sales = [ ["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75],["customer2", "milk", 4.35], ["customer3", "egg", 3.6], ["customer4", "bread", 4.5],["customer1", "milk", 4.35], ["customer2", "egg", 3.6], ["customer4", "milk", 4.35] ]>>> record = list_to_dict(sales)>>> display(record)customer1 : [['bread', 'egg', 'milk'], 16.1]customer2 : [['bread', 'milk', 'egg'], 12.45]customer3 : [['egg'], 3.6]customer4 : [['bread', 'milk'], 8.85]Write a function named dictMax which takes two arguments: a dictionary and a list. Your function must look for the keys provided in the list argument, within the dictionary argument and return the maximum of the corresponding values. For example: dictMax({1:3, 3:2, 4:5, 2:6, 7:-1, 6:-3}, [3,2,6]) will return 6, because key 3 in the dictionary corresponds to value 2, key 2 to value 6 and key 6 to value -3, and among 2, 6 and -3, the maximum is 6. If a key does not exist in the dictionary, you should omit it. If none of the keys exist in the dictionary, you should return None.
- how do i test this function in javascript function breakup(list,partitioner) { var result = {}; for(var i=0; i<list.length; i++) { var prop=partitioner(list[i]); if(!Array.isArray(result[prop])) { result[prop] = []; } result[prop].push(list[i]); } return result;} breakup( list , partitioner ) This function accepts two inputs: a list of elements and a function that accepts an element from the list. The result is an object whose properties correspond to the items returned by the partitioner and whose values are lists of elements that generated that property. Examples breakup( [ 1, 2, 3, 5, 6, 7 ], (x) => { return x % 2 == 0; } ) => { true:[ 2, 6 ], false:[ 1, 3, 5, 7 ] } breakup( [ 1.3, 5.1, 1.1, 4.3, 5.5 ], Math.floor ) => { 1:[ 1.3, 1.1 ], 4:[ 4.3 ], 5:[ 5.1, 5.5 ] } breakup( [“cat”, “bat”, “rat”, “horse”, “pony”], function(s) { return s.length; } ) => { 3:[“cat”, “bat”, “rat”], 4:[“pony”], 5:[“horse”] }get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary.remove_from_list(my_list, indices): Takes two lists as input. Creates a new list from the first input list by removing the elements at indices given by the integers in the second input list, then return the new list. The indices in the second input list may have any order. For example, if the first input list is [4, 8, 12, 16], and the second input list is [0, 2], then the new list returned from the function should have the 4 and the 12 removed, because they were at indices 0 and 2 of the original list. Note: You do not need to consider negative indices for this function. >>> remove_from_list(['abc', 'def', 'ghi'], [1]) ['abc', 'ghi'] >>> strs = ['The', 'quick', 'brown', 'fox'] >>> remove_from_list(strs, [0, 3]) ['quick', 'brown'] >>> strs ['The', 'quick', 'brown', 'fox'] # original list is unchanged >>> remove_from_list(['The', 'quick', 'brown', 'fox'], [3, 0]) ['quick', 'brown']
- C++ ONLY Add the following functions to the linked list. int getSize() -> This function will return the number of elements in the linked-list. This function should work in O(1). For this keep track of a size variable and update it when we insert a new value in the linked-list. int getValue(index) -> This function will return the value present in the input index. If the index is greater or equal to the size of the linked-list return -1. void printReverse() -> This function will print the linked list in reverse order. You don’t need to reverse the linked list. Just need to print it in reverse order. You need to do this recursively. You cannot just take the elements in an array or vector and then print them in reverse order. void swapFirst() -> This function will swap the first two nodes in the linked list. If the linked-list contains less than 2 elements then just do nothing and return. To check your code add the following code in your main function. LinkedList l;…I have given you the linear search code example on the video and I want you to go through the code and adjust the code. In the following code, list consists of number 4 twice however when you execute this code you find only the first 4. Please adjust your code to find both 4’s on the list def linear_search(list1,key): for i in range(len(list1)): if key==list1[i]: print("Element is found at index", i) break else: print("The element is not found") list1=[4,5,10,4,9,21] key=int(input("Enter a key number: ")) linear_search(list1,key)Write the function called arrange that takes a list of integers (positive and negative) as an input parameter. The arrange function must use a deque data structure to arrange the integers so the negative numbers occur before the positive numbers (note that the function doesn't sort the values). The function returns a new list containing the rearranged elements. For instance, for the input list [-3, 12, 6, -7, -1, 8], the function would return [-1, -7, -3, 12, 6, 8]. Write the main function to test the arrange function using various inputs. dequeue.py file class Deque: def __init__(self): self.items = [] def is_empty(self): return self.items == [] def add_front(self, item): self.items.append(item) def add_rear(self, item): self.items.insert(0,item) def remove_front(self): return self.items.pop() def remove_rear(self): return self.items.pop(0) def size(self): return len(self.items)