



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Consider the follwoing function: f(x) = x/x f(x) = {1 if x doesn't equal 0 {undefined is x = 0 The above function is a non-strict function for all vlaues of x except zero by f(x) is strict if x = 0. - correct answerWhat does it mean for a function to be strict? Currying is a process in which functions that accept multiple arguments or a sequence of arguments are restructured. Restructuring is done is such a way that will be equivalent to a chain of functions which accept one argument and return another function. Currying plays an important role in functional programming languages because these are those languages which generally perform most of the operations on lists. Lists are their main idea structure. - correct answerWhat is currying? What purpose does it serve in practical programs? Higher-order functions are normal functions but they either accept one or more functions as arguments or returns a function as their value. 1.Filter, 2. Map, 3. Fold - correct answerWhat is higher-order function (also known as a functional form)? Give three examples. Lists in OCaml: Lists should be homogeneous, that is they should contain elements of same type. Lists in OCaml are immutable that is once created the contents can never be changed. hd and tl functions are used hd and tl functions only work on non empty lists Lists in Lisp and Scheme Lists are heterogenous that is the elements of list can be of different types. Lists are mutable car and cdr functions are used
Memoization is implemented in parsing (top-down parsing). Parsing means dividing the given expression into tokens so that compiler can understand. This technique is also used in operating system as page segmentation. - correct answerWhat is memoization?