3i Infotech Papers: Sample Questions 780 - 782 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 780

» Basic CS » Operating System

Short Answer Question▾

Write in Short

Explain Belady’s Anomaly.

Explanation

Belady's Anomaly in figure

Belady’S Anomaly in Figure

Belady’s Anomaly in figure

  • Belady’s Anomaly is also called a FIFO anomaly.

  • Increasing number of frame allocated to a process virtual memory should make execution faster, because few page faults occur.

  • However, reverse happens i. e. the execution time increases as more frames are allocated.

  • Caused by certain page reference patterns.

  • Last replacement use page (LRU) algorithm is free from Belady’s anomaly.

Question number: 781

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

enum colors {BLACK, BLUE, GREEN}

  1. main()
  2. {
  3.     printf( “%d. %d. %d” BLACKBLUEGREEN);
  4.     return(1);
  5. }

Explanation

  • In a program

Table shows the program

Table shows the program

enum colors {BLACK, BLUE, GREEN}

Define the enum type

  1. main()
  2. {
  3.     printf( “%d. %d. %d” BLACKBLUEGREEN);
  4.     return(1);
  5. }

An enumeration consists of a set of named integer constants.

Enum assigns numbers starting from 0, if not explicitly defined

  • So the answer is 0.1. 2

Question number: 782

» Basic CS » Data Structures

Essay Question▾

Describe in Detail

What is spanning Tree?

Explanation

  • A spanning tree- subset of Graph G, with all the vertices covered with minimum possible number of edges.

  • So, spanning tree does not have cycles

  • It cannot be disconnected.

  • Every connected and undirected Graph G has at least one spanning tree.

  • A disconnected graph does not have any spanning tree; it cannot be span all its vertices.

Image of the spanning Tree

Image of the Spanning Tree

Image of the spanning Tree

  • The complete undirected graph has maximum number of spanning trees.

  • The above for example has possible spanning trees.