What is a Compiler in Computing?
10 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In computing, a compiler is a computer program that

  • is used to compile big sets of data.
  • has been used in the early days of computing to work with piles of punched cards.
  • translates source code from a high-level programming language to a lower level language to create an executable program. (correct)

In the imperative programming paradigm the programmer.

  • gives explanations of the program's logic in a natural language interspersed with snippets of traditional source code.
  • instructs the machine how to change its state. (correct)
  • declares properties of the desired result, but not how to compute it.

Purely functional languages don't have loops, because...

  • loops are inefficient.
  • loops use too much memory.
  • they don't have mutable variables. (correct)

All but one of the following Haskell expressions are equivalent. Which one is different?

<p>\n -&gt; n (D)</p> Signup and view all the answers

What makes a recursive function definition tail recursive?

<p>There's exactly one recursive call and its return value is immediately returned by the calling function. (A)</p> Signup and view all the answers

Which technique can be used to transform a recursive function definition into an equivalent tail recursive function definition?

<p>Accumulating parameters (C)</p> Signup and view all the answers

Evaluate the Haskell expression foldr (-) 1 [2,3]

<p>0 (B)</p> Signup and view all the answers

In Haskell a list [1, 2, 3] is just syntactic sugar for

<p>1:(2:(3:[])) (C)</p> Signup and view all the answers

The worst case time complexity to access a random element is...

<p>O(1) for arrays and O(n) for lists. (C)</p> Signup and view all the answers

Which of the following Haskell data type definitions uses type recursion?

<p>data Tree a = Tip | Branch (Tree a) a (Tree a) (B)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser