Posez n’importe quelle question sur les cours, conférences, exercices, recherches, actualités, etc. de l’EPFL ou essayez les exemples de questions ci-dessous.
AVERTISSEMENT : Le chatbot Graph n'est pas programmé pour fournir des réponses explicites ou catégoriques à vos questions. Il transforme plutôt vos questions en demandes API qui sont distribuées aux différents services informatiques officiellement administrés par l'EPFL. Son but est uniquement de collecter et de recommander des références pertinentes à des contenus que vous pouvez explorer pour vous aider à répondre à vos questions.
In computer science, zipping is a function which maps a tuple of sequences into a sequence of tuples. This name zip derives from the action of a zipper in that it interleaves two formerly disjoint sequences. The inverse function is unzip. Given the three words cat, fish and be where |cat| is 3, |fish| is 4 and |be| is 2. Let denote the length of the longest word which is fish; . The zip of cat, fish, be is then 4 tuples of elements: where # is a symbol not in the original alphabet. In Haskell this truncates to the shortest sequence , where : zip3 "cat" "fish" "be" [('c','f','b'),('a','i','e')] Let Σ be an alphabet, # a symbol not in Σ. Let x1x2... x|x|, y1y2... y|y|, z1z2... z|z|, ... be n words (i.e. finite sequences) of elements of Σ. Let denote the length of the longest word, i.e. the maximum of |x|, |y|, |z|, ... . The zip of these words is a finite sequence of n-tuples of elements of (Σ ∪ {#}), i.e. an element of : where for any index i > , the wi is #. The zip of x, y, z, ... is denoted zip(x, y, z, ...) or x ⋆ y ⋆ z ⋆ ... The inverse to zip is sometimes denoted unzip. A variation of the zip operation is defined by: where is the minimum length of the input words. It avoids the use of an adjoined element , but destroys information about elements of the input sequences beyond . Zip functions are often available in programming languages, often referred to as . In Lisp-dialects one can simply the desired function over the desired lists, is variadic in Lisp so it can take an arbitrary number of lists as argument. An example from Clojure: `nums' contains an infinite list of numbers (0 1 2 3 ...) (def nums (range)) (def tens [10 20 30]) (def firstname "Alice") To zip (0 1 2 3 ...