Write a function inde which returns the index (start from 1) of the occurrence of a given value. Use helper function. Two functions are enough. inde(1, [1,2,1,1,2,2,1]) → [1,3,4,7]
Q: Write a Python Program in OOP: Create a five (5) classes Classes must be used in another...
A: here we write simple python code with given requirement: ===========================================...
Q: What are the characteristics of both time-sharing and distributed operating systems, and how do they...
A: Time-sharing OS features: Each user gets a little chunk of a shared computer at a time using CPU sch...
Q: 15. Assume a computer has 24-bit addressing, and an 8192-byte cache with 64-byte lines. The cache is...
A: Given that, Number of addressing bits= 24 Cache size= 8192 bytes Cache line size= 64 bytes Number of...
Q: ider the following neural network. Assume that outputs O1, are outputs of sigmoid activation functio...
A:
Q: Write a program in the Python language to find the sum of all natural numbers in the range n to 150 ...
A: According to your question Answer is given below: Approach: Declare the variable n and use the inpu...
Q: Make Album in c++ You are going to develop a new class named Album. This class will has (at a minim...
A: Make album in C++ program ALGORITHM: Step 1: Create a class name Track Step 2: Create a title as "s...
Q: What is the purpose of smallpdf(app)? What is the goal?
A: Smallpdf application is made for a specific format of file hierarchy i.e. pdfs. It consists of multi...
Q: Consider a two-tier memory system consisting of cache (SRAM) and main memory (DRAM). The cache acces...
A: The answer is
Q: Using the input file of integers named randomNumbers.txt found in Module 6, write a Python program t...
A: Introduction Using the input file of integers named randomNumbers.txt found in Module 6, write a P...
Q: Which software development team member would make the most use of the tool,Load Runner A. Software e...
A: Load Runner :- It is an Testing tool which is used to monitor the performance of application when th...
Q: a have to create a program mmetric rod and the prograr
A: given - Project 2: You have to create a program in C language in which the user enters the mass M an...
Q: RTC means?
A: Introduction: Real-time computing (RTC) refers to hardware and software systems that are subject to ...
Q: House +numberRoom:int +type:String +Displaylofol); Bungalow +location:String +gwnerName:striog. Disp...
A: Here is The Solution.
Q: Cloud computing has the potential to have a substantial impact on the broader community. Is it possi...
A: Introduction: Computing in the cloud: Cloud computing is the process of obtaining resources from clo...
Q: What distinguishes professional software from "academic" software development?
A: Answer: In professional software development a project is developed under supervision of skilled pr...
Q: ate Foo(shared_ptr ptr) otr = TO:
A: Let’s say, you call a function named sum from main. In this case, main is the ‘calling’ function and...
Q: Discuss how you would utilize the Interactive technique of data collection at your workplace or in y...
A: There are three key collaborative strategies you can use to access the information needs of an organ...
Q: Write a regular expression that describes the following languages over the alphabet Σ = {a, b}: a) ...
A: Here in this question we have asked for regular expression a) L = {all strings that contain the subs...
Q: Write a function, to be included in a circular sorted linked list class, called greater, that will r...
A: I have answered this question in step 2.
Q: describe how salt is used in cryptography to make passwords more difficult to crack
A: Given: Explain how salt is used in cryptography to make password cracking more difficult.
Q: Consider the grammar below: S → aSb|bSa|SS|A For the string ab, how many leftmost derivations with 4...
A: : S -> aSb | bSa | SS | λ Now the leftmost derivation with number of steps is 4 or less are: a) ...
Q: Suppose your friend, Alice is trying to find all the odd numbers that are between X and Y. You want ...
A: Step-1: Start Step-2: Start a for loop i = 92 to 1092 Step-3: Check if every i is not divisible by 2...
Q: Two channels one with a bit rate of 190Kbps and another with a bit rate of 180 Kbps are to be multip...
A: The answer is
Q: Methods Java Write the appropriate method headings using the provided method name for the following ...
A: The program is written in Java. Please find the source code and output in the following steps.
Q: LVE IN MATLAB. How would I write the code to solve this in matlab?
A: It is defined as a programming language developed by MathWorks. It started out as a matrix programmi...
Q: plexity of quicksort to mergesort. While quicksort’s worst-case is O(n2) and mergesort’s is O(nlogn)...
A: Ans a)- The complexity of merge sort is O(NlogN) in all three cases which quicksort in best case and...
Q: Question2: Use affinity Diagram for creating a store space and classify and organize the following i...
A: According to our guideline we solve first one: ================================== Here below we make...
Q: House +pumberRoom:int +type:String +Displaylotol); Bungalow 3.
A: In diagram here House is Superclass and Bungalow is subclass so relationship between these cla...
Q: Figure out what kinds of connections there are between mobile devices and the cloud. What are the ad...
A: Answer : Private , public and hybrid connection are available between cloud and other devices.
Q: using python Use a Lambda function to take a list of numbers and get the square root of each number...
A: The question is to create a lambda function in python.
Q: Why is it so difficult to investigate and prosecute crimes committed on the dark web and deep web?
A: Introduction: The dark web has evolved as a key centre of illegal trade, a fully working marketplace...
Q: Write a GUI-based program to compute the new pay of an employee for a given pay raise rate. The prog...
A: Answer is given below-
Q: Discuss the advantages and disadvantages of multipurpose microcontroller pins.
A: Introduction: A microcontroller is a little device that controls all of the equipment in a computer ...
Q: 5 i%3D2 Lj=2
A: Here is the solution:
Q: Which of the following staterments is not correct? O f the relation R on a set A is reflexive then t...
A: Sort Answer: option 1 is correct. If the relation R on a set A is reflexive then the complement rela...
Q: Create a progra some basic fun
A: given - Create a program that allows the user to dosome basic functions.First, ask the user if they ...
Q: What are the differences between websites and webpages?
A: Ans : Difference between websites and webpages : Website: 1) Website is a collection of webpages dis...
Q: 2-6 3 Let A-0 -s 0 -2 B. and C- 25 Then which of the following is true? O The size of AXB is 2X3 O T...
A: First let's understand how matrix multiplicaition works :- Consider one matrix In the matrix A we h...
Q: In Web testing, explain the difference between Authorization and Authentication.
A: Difference between Authorization and Authentication in Web testing: Authorization: Authorization is ...
Q: If you read a string input: "PROGRAMMING IS FUN" using the following code, what will be the output o...
A: Here we are asking user to enter string. Using cin it able to read only one word at a time. I.e it w...
Q: B. Explain some business benefits of ERP Implementation.
A: Let us see the answer:- Introduction:- ERP is an abbreviation for Enterprise Resource Planning. ERP ...
Q: The Humane Society’s goal is to find adoptive homes for each of the animals in their care. Design a ...
A: lst=[]week=0tot=0num = int(input('How many days: '))for n in range(num): n = int(input('Enter num...
Q: Given the following sequence a0 = 2 al = 6 a2 = 10 a3 = 14 Find al00 O a. None of the choices is cor...
A:
Q: When the MPU starts up for the first time it goes to the and begins executing. Reset vector Interrup...
A: MPU is memory protection unit that provides memory protection.
Q: Discuss the principal threats to the operating system and the control techniques used to minimize th...
A: Some major threats of operating system : The following are a couple of the most well-known danger ve...
Q: Why is cybercrime becoming more common and more com
A: Introduction Why is cybercrime becoming more common and more complex?
Q: Import and edit the ShoppingCart02 project. • Declare and initialize numeric fields: – price (doub...
A: Code for Exercise (4) package shoppingcart02; public class ShoppingCart02 { public s...
Q: Please visit the website in the link provided below and perform the activity by using the Packet Tra...
A: Introduction: Layer 2 switching and Layer 3 routing are both possible with a multilayer switch like ...
Q: In the context of the impact of a change on an organization, How would you characterize the followin...
A: INTRODUCTION: Adding electronic scoreboards to cricket grounds: Viewers would be able to see the s...
Q: Visit the websites of three big technological companies (Microsoft, Oracle, and Cisco), as well as t...
A: Introduction : Websites dedicated to the most up-to-date information about security. Microsoft devel...
- Write a function inde which returns the index (start from 1) of the occurrence of a given value. Use helper function. Two functions are enough.
inde(1, [1,2,1,1,2,2,1]) → [1,3,4,7] - Write a function nele which repeats each element in a list n times. Use helper function. Two functions only.
nele([1,2],3) → [1,1,1,2,2,2] - Write a function isfact to determine if a positive integer is a factorial number. Do not use any formula such as T(n)=n(n+1)/2. Do it in recursive fashion. Two functions are enough.
isfact(120) → true
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Write a function that gets a linked list of ints, and reverses it. For example - on input 1 -> 2 -> 3 -> 4, after the function finishes the execution, the list becomes 4 -> 3 -> 2 -> 1 - If the list has one element, then it doesn’t change - If the list is empty, then it doesn’t change You may use the data fields in the struct and the functions provided in LL.h and LL.c. // reverses a linked list void LL_reverse(LL_t* list); Test for the Function; void test_q3() { LL_t* lst = LLcreate(); LL_add_to_tail(lst, 1); LL_add_to_tail(lst, 3); LL_add_to_tail(lst, 8); LL_add_to_tail(lst, 4); LL_add_to_tail(lst, 3); LL_reverse(lst); intcorrect[] = {3,4,8,3,1}; inti; node_t* n = lst->head; for(i=0;i<5;i++) { if (n==NULL) { printf("Q3 ERROR: node %d==NULL unexpected\n", i); return; } if (n->data != correct[i]) { printf("Q3 ERROR: node%d->data==%d, expected %d\n", i, n->data, correct[i]); return; } n = n->next; } if (n==NULL) printf("Q3 ok\n"); } Support File…Question 1 write a curried SML function, filter, that takes two arguments, a predicate ( a function that takes a single argument and returns a bool) and a list. Calling filter f L returns a list containing only those elements of L that satisfy f (that is, only those elements that f returns true for are in the resulting list). Calling filter with an empty list returns an empty list. List members should appear in the same order in the results as in L. Do not use explicit recursion Full explain this question and text typing work only thanksWrite a function with the signature below that returns the sum of the last k elements of a singly linked list that contains integers. int returnSumOfLastKNodes(Node* head, int k) Example: 10 -> 5->8->15->11->9->23 10 represents the head node, returnSumOfLastKNodes(Node* head, 4) will return 58.
- List of triples or a triple of lists? Write a function l3_of_3l : ’a list * ’b list * ’c list -> (’a * ’b * ’c) list = that transforms a triple of lists into lists of triples. If lengths don’t match then ignore leftover elements. examples l3_of_3l ([1;2;3],[1.;2.],[’a’;’b’;’c’;’d’]);; - : (int * float * char) list = [(1, 1., ’a’); (2, 2., ’b’)] l3_of_3l ([1.;2.],[’a’;’b’;’c’;’d’],[1;2;3]);; - : (float * char * int) list = [(1., ’a’, 1); (2., ’b’, 2)]Write a function that takes a list removal(L), delete from it all the elements whose indicesare divisible by 3. And return the resulting list after removing unwanted elements.Example:>>>removal(['A', 'B', 'C', 'D', 'E'])['B', 'C','E'Please answer it in Python Write a function insere_milieu that takes as an argument a list l and an element elem and returns the list obtained from l by adding elem "in the middle" of l, that is: If the length of l is even, the item is added once, in the middle of the list. If the length of l is odd: the element is added on either side of the central element. Example: insere_milieu([4, 7, 12, 3], 0) is [4, 7, 0, 12,3] insere_milieu([9, 3, 5, 6, 2], 1) is [9, 3, 1, 5, 1, 6, 2].
- We have a list. For example [2,4,6,6,8,2,12,54,15]. Without repeating the elements in the list a new list that does not repeat its elements by creating and using the function that writes Create.(This question is for a linked list of the type described on the front page, Item 5). Write a recursive function CountGE60. that receives a linked list (may or may not be empty) and returns the number of nodes (each containing a data item value) greater than or equal to 60.Please answer it in Python Write a function extrait_pairs that takes as an argument a list l1 and returns the list obtained from l1 keeping only the even integers (and without changing their order). Be careful, l1 must not be modified by the function. Example: extrait_pairs([4, 7, 12, 0, 3]) is [4, 12, 0] and extrait_pairs([21, 17, 3]) is [ ].
- (a) Write a function top_students(marks) that takes as a parameter a non-empty list of (name, mark) tuples, where name is the name of a student (a string) and mark is the student's mark for some course (an int). The function returns a list of the names of all students whose mark equals that of the top student. If there is just a single student with the maximum mark, the return value will be a list of length 1, as in the first example in the table below. The names in the return list should be in the same order as in the input parameter list. Test Result marks = [('Beatrice', 50), ('Nerly', 90), ('Uniza', 70)] print(top_students(marks)) ['Nerly'] marks = [('Beatrice', 80), ('Nerly', 75), ('Uniza', 66), ('Joshua', 80)] print(top_students(marks)) ['Beatrice', 'Joshua'] (b) Write a function char_counts(string) that takes a string as a parameter and returns a dictionary in…Write a function split n l that splits the list l and returns a pairof lists containing the first n elements of l and the rest of l, wheresplit has the type int -> ’a list -> (’a list * ’a list). For ex-ample, split 3 [1,2,3,4,5] returns the pair ([1,2,3], [4,5]) andsplit 3 [1,2,3] returns ([1,2,3], []).Suppose we have a singly linked list implemented with the structure below and a function that takes in the head of the list.typedef struct node{int num;struct node* next;} node;int whatDoesItDo (node * head){struct node * current = head;struct node * other, *temp;if (current == NULL)return head;other = current->next;if (other == NULL)return head;other = other->next;temp = current->next;current->next = other->next;current = other->next;if (current == NULL){head->next = temp;return head;}other->next = current->next;current->next = temp;return head;}If we call whatDoesItDo(head) on the following list, show the list after the function has finished.head -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7