Divakaran Gkd

EduRev UPSC

Divakaran Gkd
EduRev UPSC
Content, tests & courses saved by you for accessing later. (visible to you only)

Currently preparing for

Computer Science Engineering (CSE)
Discussed Questions

Example 1:
Consider array has 4 elements and a searching element 16.
A[4]= {10, 16, 22, 25} 
The number of iterations are required to search an element by using a binary search= T1
Example 2:
Consider array has 4 elements and a searching element 22.
A[4]= {10, 16, 22, 25} 
The number of iterations are required to search an element by using a binary search= T2
Note: Searching is successful.
Q.Which of the following statement are true?
  • a)
    T1 = T2
  • b)
    T1 < T2
  • c)
    T1 >T2
  • d)
    T2 < T1
Correct answer is option 'B'. Can you explain this answer?

Sankar Sarkar answered  •  1 week ago
Understanding Binary Search Iterations
Binary search is an efficient algorithm used to find an element in a sorted array. The number of iterations required to find an element can vary based on the position of the element being searched.
Example Analysis
- Array Elements: A[4] = {10, 16, 22, 25}
- Searching Element for Example 1: 16
- Searchin
... more: 22
Iteration Details
- T1 (Searching for 16):
- Start with the entire array: indexes 0 to 3.
- Middle index = 1 (value = 16).
- Found in 1 iteration.
- T2 (Searching for 22):
- Start with the entire array: indexes 0 to 3.
- Middle index = 1 (value = 16).
- Since 22 > 16, search the right half (indexes 2 to 3).
- New middle index = 2 (value = 22).
- Found in 2 iterations.
Conclusion
- Comparison of Iterations:
- T1 (1 iteration) is less than T2 (2 iterations).
Thus, the statement T1 < /> is correct, making option b the true statement.
Summary of Options
- a) T1 = T2: False
- b) T1 < t2:="" />
- c) T1 > T2: False
- d) T2 < t1:="" />
Understanding the binary search algorithm's mechanics is crucial in determining how many iterations are needed based on the searched element's position.

Let w= xyz and y refers to the middle portion and |y|>0.What do we call the process of repeating y 0 or more times before checking that they still belong to the language L or not?
  • a)
    Generating
  • b)
    Pumping
  • c)
    Producing
  • d)
    None of the mentioned
Correct answer is option 'B'. Can you explain this answer?

Sankar Sarkar answered  •  Mar 13, 2024

Process of Repeating y before checking language membership

Generating:
- Generating typically refers to creating something new, which may not apply in this context.

Pumping:
- The process of repeating the middle portion y in the string before checking if it belongs to the language is called pumping.
- This process involves taking the middle
... more

Which join refers to join records from the write table that have no matching key in the left table are include in the result set:
  • a)
    Left outer join
  • b)
    Right outer join
  • c)
    Full outer join
  • d)
    Half outer join
Correct answer is option 'B'. Can you explain this answer?

Sankar Sarkar answered  •  Mar 13, 2024


Right Outer Join Explanation:

The right outer join, also known as a right join, includes all the records from the right table (write table) and only the matching records from the left table. If there is no match found in the left table, NULL values are filled in for the columns from the left table.

Key Points:
- The right outer join is used to j
... more

An automaton that presents output based on previous state or current input:
  • a)
    Acceptor
  • b)
    Classifier
  • c)
    Transducer
  • d)
    None of the mentioned.
Correct answer is option 'C'. Can you explain this answer?

Sankar Sarkar answered  •  Mar 13, 2024

Transducer

Transducer is an automaton that presents output based on previous state or current input. Let's break down this concept further:

Definition:
- A transducer is a device that converts one form of energy into another. In the context of automata theory, a transducer is a type of machine that transforms input symbols into output symbols.
... more

If we select a string w such that w∈L, and w=xyz. Which of the following portions cannot be an empty string?
  • a)
    x
  • b)
    y
  • c)
    z
  • d)
    all of the mentioned
Correct answer is option 'B'. Can you explain this answer?

Sankar Sarkar answered  •  Mar 13, 2024

Explanation:

Given: w = xyz, where w ∈ L

Breakdown of w:
- Let w = xyz, where x, y, z are substrings of w.

Portions of w:
- x is the portion before y
- y is the portion in the middle
- z is the portion after y

Reasoning:

Option B (yc):
- The portion y cannot be empty beca
... more

With reference of a DPDA, which among the following do we perform from the start state with an empty stack?
  • a)
    process the whole string
  • b)
    end in final state
  • c)
    end with an empty stack
  • d)
    all of the mentioned
Correct answer is option 'D'. Can you explain this answer?

Sankar Sarkar answered  •  Mar 13, 2024

DPDA Processing from Start State with an Empty Stack

Processing the Whole String:
- In a DPDA, when starting from the initial state with an empty stack, the machine begins processing the input string character by character.
- The DPDA transitions to different states based on the current input symbol and the top of the stack.
- The machine continues processing
... more

Which of the following memory medium is not used as main memory system?
  • a)
    Magnetic core
  • b)
    Semiconductor
  • c)
    Magnetic tape
  • d)
    Both (a) and (c)
Correct answer is option 'D'. Can you explain this answer?

Sankar Sarkar answered  •  Feb 06, 2024
Explanation:

Main memory, also known as primary memory or RAM (Random Access Memory), is a crucial component of a computer system. It is responsible for storing data and instructions that are actively being used by the CPU (Central Processing Unit). There are various types of memory media available, but not all of them are suitable for use as main memory.

Let's analyz
... more

When a point inside of a tetrahedron (a solid with four triangular surfaces) is connected by straight
lines to its corners, how many (new) internal planes are created with these lines? _____________
    Correct answer is '6'. Can you explain this answer?

    Sankar Sarkar answered  •  Dec 31, 2023
    Introduction:
    A tetrahedron is a solid geometric shape with four triangular faces. When a point inside the tetrahedron is connected by straight lines to its corners, it creates several new internal planes. In this response, we will explain why the correct answer is 6.

    Explanation:
    To understand the number of internal planes created, let's break down the process s
    ... more

    Which property of database transaction create an allusion than only 1 transaction is executed in system in spite of more than one transaction is executed in parallel manner?
    • a)
      Atomicity
    • b)
      Consistency
    • c)
      Isolation
    • d)
      Durability
    Correct answer is option 'C'. Can you explain this answer?

    Sankar Sarkar answered  •  Oct 21, 2023
    Isolation

    The property of isolation in database transactions ensures that concurrent transactions do not interfere with each other, creating the illusion that only one transaction is executed in the system, even though multiple transactions may be executed in parallel. It provides a way to maintain the integrity and consistency of the data in a multi-user environment.

    ... more
    Sankar Sarkar asked   •  Jul 01, 2021

    A thread is usually defined as a "light weight process" because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?
    • a)
      On per-thread basis, the OS maintains only CPU register state
    • b)
      The OS does not maintain a separate stack for each thread
    • c)
      On per-thread basis, the OS does not maintain virtual memory state
    • d)
      On per-thread basis, the OS maintains only scheduling and accounting information
    Correct answer is option 'C'. Can you explain this answer?

    Sanya Agarwal answered
    Threads share address space of Process. Virtually memory is concerned with processes not with Threads. A thread is a basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers, (and a thread ID.) As you can see, for a single thread of control - there is one program counter, and one sequence of instructions that can be carried out at any given time and for multi-threaded applications-there are multiple threads within a single process, each having their own program counter, stack and set of registers, but sharing common code, data, and certain structures such as open files.
    Option (A): as you can see in the above diagram, NOT ONLY CPU Register but stack and code files, data files are also maintained. So, option (A) is not correct as it says OS maintains only CPU register state.
    Option (B): according to option (B), OS does not maintain a separate stack for each thread. But as you can see in above diagram, for each thread, separate stack is maintained. So this option is also incorrect.
    Option (C): according to option (C), the OS does not maintain virtual memory state. And It is correct as Os does not maintain any virtual memory state for individual thread.
    Option (D): according to option (D), the OS maintains only scheduling and accounting information. But it is not correct as it contains other information like cpu registers stack, program counters, data files, code files are also maintained.

    Sankar Sarkar asked   •  Dec 31, 2020

    A shopkeeper marked the price of an article by 40% above cost price and gave discount of Rs. 224. On the final amount, he charged 10% tax. In the whole transaction, he earned Rs. 158.6. Find cost price of the article. 
    • a)
      Rs 750 
    • b)
      Rs 760 
    • c)
      Rs 744 
    • d)
      Rs 757 
    • e)
      Rs 748
    Correct answer is option 'A'. Can you explain this answer?

    Raksha Mishra answered
    let cost price be Rs. 100x 
    Marked price = 140 /100 × 100x = Rs 140x 
    Selling price = Rs (140x − 224) 
    Selling price after tax = 110/100 × (140x − 224) = Rs (154x − 246.4) 
    ATQ, 100x + 158.6 = 154x − 246.4 
    x = 7.5 
    Cost price of article = 100x = Rs 750

    Sankar Sarkar asked   •  Dec 06, 2019

    Which one of the following statements is FALSE?
    • a)
      Packet switching leads to better utilization of bandwidth resources than circuit switching
    • b)
      Packet switching results in less variation in delay than circuit switching
    • c)
      Packet switching requires more per-packet processing than circuit switching
    • d)
      Packet switching can lead to reordering unlike in circuit switching
    Correct answer is option 'B'. Can you explain this answer?

    Gaurav Verma answered
    • Circuit switching has 3 phase: connection establishment, Data transfer and tear down, while packet switching has only one phase data transfer based on routing,
    • Circuit switching has less variation in packets than packet switching.
    • Circuit switching send packet in order, while packet switching send out of order, so reordering needs in packet switching.
    • In packet ... more
    • In circuit switching no packet processing needed at intermediate path routers while in packet switching needed. So, packet switching require more packet processing time than circuit switching.

    Fetching relevant content for you