Basic CS [3i Infotech Placement]: Sample Questions 202 - 204 of 243

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

Question 202

Edit

Write in Short

Short Answer▾

What is a binary semaphore? What is its use?

Explanation

State Diagram of Binary Semaphore
  • Binary semaphores are binary- can take only two values.
  • “1” might represent a process is in the critical section and other should wait, the other indicating the critical section is free.
  • Sometime easier to implement than counting semaphore.
  • Binary semaphore are used as mutex locks, to implement mutual exclusion and synchronize concurrent processes.

Question 203

Basic CS

Write in Short

Short Answer▾

Binary equivalent of

Explanation

  • Divide by
    • reminder
    • , remainder is
    • , remainder is
    • , remainder is
    • , remainder is
    • , remainder is
  • Read from bottom to top as
  • This is the binary equivalent of decimal number

Question 204

Question

MCQ▾

In tree construction which is the suitable efficient data structure?

Choices

Choice (4)

a.

Queue

b.

Linked list

c.

Stack

d.

Array

Answer

b.

Explanation

Defination of Link List
  • A linked list is a sequence of data structures connected to each other via links.
  • Linked list is a sequence of links which contains items.
  • Each link contains a connection to another link.
  • The second most-used data structure after array.

Important terms to understand the concept of Linked List:

  • Link
    • Every link of a linked list stores a data called an element
  • Next
    • Every link of a linked list contains a link to the next link called next.
  • Linked List
    • Contains connection link to the first link called first.
The Concept of Linked List

Developed by: