Computer Science Quiz on Automata and Algorithms
48 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

What is the minimum possible number of states required in a deterministic finite automaton (DFA) to recognize the regular language L = {w₁aw2 | w₁, w₂ ∈ {a, b}*, |w₁| = 2, |w₂| ≥ 3}?

  • 5
  • 8 (correct)
  • 10
  • 16
  • A graph G has n vertices and 25 edges. If each vertex has a degree of at least 3, what is the maximum possible value for n?

  • 14
  • 12
  • 18
  • 16 (correct)
  • What is the correct interpretation of the statement 'static char var;'?

  • The variable var is allocated memory in the data segment of memory. (correct)
  • The variable var is allocated memory in the stack segment of memory.
  • The variable var is allocated memory in the heap segment of memory.
  • The variable var is allocated memory dynamically during runtime.
  • Consider the following C code snippet: 'm = malloc(10); m = NULL;'. What does this code do?

    <p>It allocates 10 bytes of memory but then makes the pointer m invalid, resulting in a memory leak. (C)</p> Signup and view all the answers

    Which of the following statements correctly describes the Towers of Hanoi algorithm with 'n' disks, in terms of its time complexity?

    <p>O(2<sup>n</sup>) (A)</p> Signup and view all the answers

    Which of the following statements is TRUE about a connected UDP socket in Linux?

    <p>A process can successfully call the connect function again for an already connected UDP socket. (A)</p> Signup and view all the answers

    What is the time complexity of adding two n x n matrices?

    <p>O(n<sup>2</sup>) (B)</p> Signup and view all the answers

    Which of the following statements is CORRECT about a circular queue implemented using a singly linked list with FRONT and REAR pointers?

    <p>The next pointer of the front node points to the rear node. (C)</p> Signup and view all the answers

    Which of the following statements concerning RIP is TRUE?

    <p>RIP utilizes distance-vector routing. (C), RIP relies on UDP for packet transmission. (D)</p> Signup and view all the answers

    Which routing protocol relies on TCP for packet transmission?

    <p>OSPF (A)</p> Signup and view all the answers

    Which of the following statements accurately describes the relationship between SLR, LALR, and Canonical LR parsing techniques?

    <p>Canonical LR is more powerful than SLR. (C)</p> Signup and view all the answers

    Suppose a machine has a 2^32 byte memory, divided into blocks of 32 bytes each. This machine utilizes a direct-mapped cache with 512 cache lines. What is the size of the tag field in bits for this cache?

    <p>18 bits (A)</p> Signup and view all the answers

    Consider two individuals, P and Q, applying for a job. The probability of P applying is 1/4, the probability of P applying given Q applies is 1/2, and the probability of Q applying given P applies is 1/3. What is the probability that P does not apply for the job, given that Q does not apply?

    <p>4/5 (C)</p> Signup and view all the answers

    Which of the following languages are regular?

    <p>L₂ = {a^n b^m c^(2m) | n ≥ 0, m ≥ 0} (D)</p> Signup and view all the answers

    Which of the following languages are context-free but not regular?

    <p>L₁ = {a^p | p is a prime number} (B)</p> Signup and view all the answers

    The memory hierarchy described in the text consists of I-cache, D-cache, L2-cache, and main memory. Considering the given read access times and hit ratios, what is the average read access time for memory operand fetch?

    <p>25.8 nanoseconds (D)</p> Signup and view all the answers

    How many multiple choice questions are included in the exam if the total mark is 100 and consists of both multiple choice and essay questions?

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

    Which building is situated in the middle based on the given positional relationships of buildings V, W, X, Y, and Z?

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

    Which phrase correctly completes the sentence about Saturn being visible at night?

    <p>bright enough (A)</p> Signup and view all the answers

    Identify the option that contains words that are not synonymous.

    <p>yielding, resistant (B)</p> Signup and view all the answers

    What is the probability of selecting two socks of the same color from a collection of red, green, and blue socks?

    <p>4/15 (A)</p> Signup and view all the answers

    If X is a 30-digit number starting with the digit 4 followed by the digit 7, how many digits does X³ have?

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

    In the scenario involving three incorrectly labeled boxes, what is the best box to open to determine the contents?

    <p>The box labeled both (D)</p> Signup and view all the answers

    Which of the following sentences is grammatically incorrect regarding the visibility of Saturn?

    <p>Saturn is enough bright to be seen. (B)</p> Signup and view all the answers

    In the provided text, what is the author's primary argument concerning literature?

    <p>Literature holds intrinsic merit and should not be solely valued for its ideological contributions. (D)</p> Signup and view all the answers

    What is the main function of the air pressure contour lines in the provided plot?

    <p>To depict changes in atmospheric pressure across the region. (A)</p> Signup and view all the answers

    Which of the following statements best describes the author's view on the interpretation of actions in the country they describe?

    <p>Gestures, even personal ones, are solely interpreted through a political lens. (B)</p> Signup and view all the answers

    According to the grammar provided, which of the following strings is a member of the language generated?

    <p>aaabbb (A)</p> Signup and view all the answers

    What is the decimal value of the single-precision IEEE-754 floating-point number represented by 00111110011011010000000000000000?

    <p>2.27 (D)</p> Signup and view all the answers

    Which option accurately reflects the order in which nodes would be visited by the Breadth First Search (BFS) algorithm, assuming we start at node 'M' in the provided graph?

    <p>POQNMR (D)</p> Signup and view all the answers

    Analyzing the air pressure contour plot provided, which region shows the steepest gradient in air pressure?

    <p>R (D)</p> Signup and view all the answers

    Which of the following options represents a common misconception about the Breadth First Search (BFS) algorithm?

    <p>BFS always visits the node with the highest degree first. (A)</p> Signup and view all the answers

    What is the condition being checked in option (c)?

    <p>Variable q is zero, r equals x, and y is greater than zero. (B)</p> Signup and view all the answers

    Given a B+ tree with a block size of 512 bytes, what information does the maximum order of 52 represent?

    <p>The maximum number of keys that can be stored in a single node. (D)</p> Signup and view all the answers

    How many tuples does the provided SQL query return from the top_scorer table?

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

    In the given networking scenario, which option best describes what p and q represent?

    <p>Transmission delay is p and propagation delay is q in milliseconds. (B)</p> Signup and view all the answers

    What is the average waiting time in milliseconds for processes using preemptive priority scheduling?

    <p>29 (D)</p> Signup and view all the answers

    What will the C program output when executed?

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

    How many total characters are in the character set X = {P, Q, R, S, T}?

    <p>5 (D)</p> Signup and view all the answers

    In the context of the data provided, what is the significance of 'goals > ANY' in SQL?

    <p>It checks if a player's goals are greater than at least one German player. (D)</p> Signup and view all the answers

    What is the maximum number of router addresses that can be listed in the Record Route (RR) option of an IPv4 header?

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

    In the context of the C function 'printxy', what is the correct output when calling 'printxy(1, 1)'?

    <p>1, 0 (D)</p> Signup and view all the answers

    Given the function f(x) = R sin(πx/2) + S, with f'(π/2) = √2 and ∫(f(x)dx from 0 to π = 2R/π, what are the values of R and S?

    <p>π/4 and 0 (D)</p> Signup and view all the answers

    Which compiler phase is responsible for processing the token stream?

    <p>Syntax Analyzer (A)</p> Signup and view all the answers

    What is the logical representation of the statement: “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold”?

    <p>(¬p^r)^(¬r → (p^q)) (A)</p> Signup and view all the answers

    What is the rank of the matrix P + Q, where * P = [1 1 -1 7] and Q = [-1 -2 -1] [2 -3 4] [6 12 6] [5 10 5] [3 -2 3] *?

    <p>2 (D)</p> Signup and view all the answers

    Which of the following statements about the routing protocols RIP and OSPF are correct?

    <p>All of the above. (D)</p> Signup and view all the answers

    What is the minimum number of ordered pairs that need to be added to the relation R to make (X, R) a lattice, where X = {a, b, c, d, e} and R = {(a, a), (a, b), (a, c), (a, d), (a, e), (b, b), (b, c), (b, e), (c, c), (c, e), (d, d), (d, e), (e, e)}?

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

    Study Notes

    • No information provided to generate study notes. Please provide text or questions.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    Test your knowledge on deterministic finite automaton, C programming, time complexity, and network protocols with this quiz. Each question evaluates understanding of key concepts in computer science and programming. Challenge yourself to see how well you grasp these topics!

    More Like This

    DFA Quiz
    0 questions

    DFA Quiz

    SuppleSard9813 avatar
    SuppleSard9813
    Deterministic Finite Automaton (DFA)
    3 questions
    Finite Automata Overview
    10 questions
    Use Quizgecko on...
    Browser
    Browser