Problem 1 Write a function count123: int list -> int *int int that takes in an int list 1 and returns a 3-tuple of integers counting the number of 1's, 2's and 3's respectively in 1. For example, count 123 [3; 4;2;1;3] = (1,1,2), and count123 [4; 4; 1; 2;1] = (2,1,0). In [] let count123 1 = (* YOUR CODE HERE *) In [ ]: assert (count123 [3; 4; 2;1;3] = (1,1,2))
Q: What type of recursion is present in the method below? public static void mystery (int x, int y) {…
A: When making decisions, if-else statements are used to describe which block of code should be run…
Q: Construct the FIRST and FOLLOW for the grammar: A → BC | EFGH|H B → b C→C | E E → ele F→→ CE G g H→…
A: Introduction: Below Construct the FIRST and FOLLOW for the grammar: A → BC | EFGH | H B→b C→c|€…
Q: Consider the grammar below: S →aBCa B →dBd | a C → eCe | a (a) Construct the LR(0) canonical set of…
A: Context Free Grammar S -> aBCa B -> dBd | a C -> eCe | a SLR 1 Items:
Q: Solve each recurrence below using the 2. Recurrences (Master Method). Master Method and write your…
A:
Q: Formalize the following sentence in english: 3X. elephant (X)
A: Here in this question we have given a predicate logic sentence.and we have asked to convert it into…
Q: What are the applications of PSO and ACO?
A: In the given question PSO is inspired by the flock of birds or fishes in food search while ACO is…
Q: In linux: Describe full pathname and relative pathname with an example.
A: Solution:
Q: Describe an algorithm that given two regular expressions R1 and R2 outputs YES if and only if every…
A: To determine if every string generated by R1 is also generated by R2, we can iterate through every…
Q: Q. 22 Compare MD5 with SHA-1
A:
Q: SAKMP protoco
A: This ISAMKP protocol is a framework for the establishing dynamic security associations and…
Q: Compute 13^-1 (mod 19) using Fermat Little Theorem. Show all work/proof
A: Femat Little theorem states that if p is a prime no then a^p - a is an integer multiple of p. That…
Q: W.X 14 1 1 y2 32 32 1 I 1 (c) 1 1 1 1 1 a. wxyz'+wxy'z'+wx'yz +wx'yz' +wx'y'z'+w'x'yz'…
A: INTRODUCTION: In a Karnaugh map, or truth table, a minterm is a Boolean expression that returns 0s…
Q: d in a remote invocation, with C acting as the client while S acts as the server. • Highlight the…
A: These are the steps in the request and response sequence: We opens the browser i.e. we the clients…
Q: What type of recursion is present in the method below? public static void mystery (int x, int y) {…
A: When making decisions, if-else statements are used to describe which block of code should be run…
Q: Write a while loop that prints the multiples of 3 from 300 down to 3. A decrement operator (++ or…
A: Here I have defined a variable named num and initialized it with a value of 300. Next, I have…
Q: Linear regression aims to fit the parameters based on the training set Tx D = {(x(i),y(i)), i = 1,…
A: Introduction The linear regression analysis is expected to play out the forecast of the variable by…
Q: Select the class relationship that best describes the following scenario: • Class B creates an…
A: UML stands for Unified Modelling language, It is a type of general purpose modeling language used to…
Q: QUESTION 3 Counters are similar to timers, except that they do not operate on an internal clock.…
A: In digital logic and computing, a counter is a device that stores (and displays) the number of times…
Q: Select the answer that best describes the following statements: I. An object is a template or design…
A: Please find the detailed answer in the following steps.
Q: ity and a Strong Relationship. Provide a simple ER diagram of a Strong Entity and Weak…
A: Weak entity is represented by double rectangle in the diagram. The relation between one strong and…
Q: What feature of Google/Apple Maps would you like to alter or add? Explain in both words and…
A: The feature of Google maps/Apple maps I like to add is as follows :
Q: When it comes to cloud security, what is the "shared responsibility" paradigm like?
A: Answer: The industry has coined the term "Shared Responsibility" to describe the tasks and…
Q: Write a Python function named check_email(email_address) takes as input a string (possibly)…
A: Here is the python code of the above problem. See below steps.
Q: Construct the FIRST and FOLLOW for the grammar: A → BC | EFGH | H B → b C→CE E→ ee F→CE G➜g
A: Given, A → BC | EFGH | H B → b C → c | ɛ E → e | ɛ F → CE G → g H → h | ɛ
Q: Analyse the following statement: • Database Management Systems and Data-Warehousing techniques are…
A: Answers:- the Privacy Brief has the right to be free from any undue personal intrusion. Information…
Q: Which of the following uses the parameter entity? O a. DTD file O b. XML file O c. jQuery O d. XSL…
A: Ans: The following that uses the parameter entity is: a) DTD file
Q: I need help fixing an error in my code and I don't know how to fix it
A: The error occurs because the C++ compiler did not recognize the functions countTarget, append, and…
Q: Using python programming language find the maximum value of expression (A[1₁] © A [I₁ + 1] © ... ©…
A: According to the given question we have to maximize the value of the given expression. using for…
Q: What needs to be written in the blanks of the following gist: friends = {'Tom': 'May', 'Jim': 'Jan',…
A: When I will put _a_ -> friend and _b_ -> friend and _c_ -> friends[friend]. Then it will…
Q: Two DNA strands of length 100 (number of bases in the sequence) are given in DNA1.txt and DNA2.txt…
A: 1) Since you have asked multiple questions, we will solve the first question for you. If you want…
Q: Two DNA strands of length 100 (number of bases in the sequence) are given in DNA1.txt and DNA2.txt…
A: Python introduction:- Similar to the English language, Python has a straightforward syntax. Python…
Q: Is the following table in First Normal Form? If so, how would you get it into first normal form.…
A: Solution- Introduction-It will be challenging to manage and update the database if a table includes…
Q: Let EK: {0,1}128 → {0, 1}128 be an ideal block cipher with message space {0, 1}128, ciphertext space…
A: Hash function The purpose of a hash function is to fit a set of inputs of any size into the a table…
Q: Explain about smart student monitoring system
A: In this question we need to explain the the Student student monitoring system (SSMS).
Q: For the following signed 2's compliment values Perform actions (indicate overflow): A+B= A - B = A =…
A: Given: A = 0x0F B = 0xAC For the above signed 2's compliment values, we have to perform following…
Q: Show how the decimal floating point number -76.310 is stored in the computer's storage using IEEE754…
A: Here in this question we have given a decimal number -76.3 and we have asked to convert it into IEEE…
Q: In python. Please do not copy from other websites, as it is incorrect and I'd like to be able to…
A: As per the given question, we need to implement TargetNotFound exception class that raises a…
Q: Design a full subtractor circuit performing A-(B-C) using optimum…
A: Answer the above question are as follows
Q: 1. Determine the entropy associated with the following method of generating a password. Choose, and…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Show how the decimal floating point number -76.310 is stored in the computer's storage using IEEE754…
A: Introduction Here during this question we've given a decimal range -76.3 and that we have asked to…
Q: What are the theta values for the recurrences given below in Q1-Q3? (Show your work in details) (1)…
A:
Q: Write a short note on: fuzzy expert system.
A: The answer to the question is given below:
Q: Question 2: Feature Engineering Having considered missing data, we can now further prepare our…
A: Here I have defined the method named extract_title(). Inside the function, I have used a loop to…
Q: Explain types of Intrusion detection systems (IDS).
A: Intrusion Detection System: Intrusion detection system is a application or device that is used to…
Q: In python. Please explain so it can be applied to future problems. Thanks. Write a bubble sort that…
A: As per the given question, we need to implement the functions bubble_values and insertion_values.…
Q: Defined below is a simple main method that calls upon surprise(int a, int b, int c), a recursive…
A: Solution:
Q: Modify the algorithm for Knapsack described in class to return the set of objects with the maximum…
A: The Knapsack algorithm is a dynamic programming algorithm that is used to solve the Knapsack…
Q: what type of Big O time complexity is O(a * b) ? Does O(a * b) reduce to O(a) = O(n)/linear?
A: Does O(a * b) reduce to O(a) = O(n)/linear? Answer: No, a*b will take constant time so it is not an…
Q: Examining and modifying the contents of the 8086's internal registers 1. Use the REGISTER command to…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: Select the class relationship that best describes the following scenario: • Class A accepts an…
A: Solution: Given,
OCAML Problem
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Suppose a node of a linked list is defined as follows in your program: typedef struct{ int data; struct Node* link; } Node; Write the definition of a function, printOdd(), which displays all the odd numbers of a linked list. What will be the time complexity of printOdd()? Express the time complexity in terms of Big-O notation.Python Please Implement a function dedup(lst: list) -> list: that returns a de-duplicated version of the input list. Elements appear in the same order as the input list, but subsequences of equal elements are replaced by one representative. For example, dedup([]) = [], dedup([1, 1, 2, 1, 1]) = [1, 2, 1].In Ocaml 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) ]
- 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 [ ].In SML write a function posLL to count a number of positive values in an int list list. One function only. posLL[nil,[~2,3], [5], [~7,11]] > 3Write a function Delete(x,L) in Pascal that deletes last occurrence of x in a singly linked list and returns the number of elements (not the elements*) before the deleted element x. MANDATORY FOR CODE TO BE IN PASCAL.
- Please answer it in Python Write a function min_pair that takes a list as an argument and returns the smallest even integer contained in the list. If the list contains no even integers, the function will return None. Example: min_pairs([4, 7, 12, 0, 21, 5]) is 0 min_pairs([9, 3, 1]) is None. min_pair([16, 13, 10, 102, 7, 23]) is 10(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.1. a function that takes in a list (L), and creates a copy of L. note: The function should return a pointer to the first element in the new L. [iteration and recursion]. 2. a function that takes in 2 sorted linked lists, and merges them into a single sorted list. note: This must be done in-place, and it must run in O(n+m).
- Write a function cmid to count elements of an integer list between 5 and 10. One function only.cmid [12,3,6,4,5,1] → 2List 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 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], []).