3i Infotech Placement: Sample Questions 740 - 741 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 740

Edit

Describe in Detail

Essay▾

What are the methods available in storing sequential files?

Explanation

Straight merging:

  • This is straight sorting technique.
  • The straight merge distributes the initial records onto two tapes
  • They contain the same number of records; one tape contains only one more record than the other.
  • If done for the original file then the configuration of tapes appear as the initial distribution.

Natural merging:

  • Distributes the records of the original file to two tapes, so that sorted sub files or runs are preserved and treated as a unit.

Polyphase sort:

  • An algorithm decreases the number of runs at every iteration of the main loop merging run into large runs.
  • It uses external sorting.
  • Reduces the number of intermediate files needed by reusing files.

Question 741

Edit

Describe in Detail

Essay▾

What does static variable mean?

Explanation

  • Static variable is available throughout the lifetime.
  • At the time of starting the program execution, static variables allocations take place.
  • They cover a scenario where one variable is to used by all the functions, or the variable needs to survive across function invocations.
  • Variables are declared static in a C program.
  • For variables declared in the function, the value of the variable is persisted between successive calls to functions- access qualifier limits the scope but causes the variable to exist for the lifetime of the program.
  • Function static variable is thus not seen outside the function in which it is declared but remains until the program terminates.
  • The value of variable will remain and may be seen even after calls to a function.

Developed by: