Basic CS-Data Structures [TCS Placement]: Sample Questions 5 - 7 of 28

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 5

Data Structures
Edit

Write in Short

Short Answer▾

Sorting in not possible by using which of the following methods? (Insertion, selection, exchange, deletion)

Explanation

  • Sorting is not possible with Deletion.
  • Using insertion - perform insertion sort.
  • Using selection- perform selection sort.
  • Using exchange- perform the bubble sort (or others) .
  • No sorting method just uses deletion.

Question 6

Data Structures
Edit

Write in Short

Short Answer▾

Which is the simplest file structure? (sequential, indexed, random)

Explanation

  • Sequential is the simplest file structure
  • In a sequential file records can only be accessed one after another from beginning to end
  • Records are stored one after another in auxiliary storage, such as tape or disk finally culminated with EOF (end-of-file) .
  • The operating system has no information about record addresses, it only knows where the whole file is stored and that the records are sequential.
Given the Image is Define the Sequential File Structure

Question 7

Data Structures
Edit

Describe in Detail

Essay▾

What are the various operations that can be performed on different data structures?

Explanation

  • Insertion: Add a new data item in the given collection of data items- new element can be added at the beginning, end, or at any given position.
  • Deletion: Delete existing data from collection of data items.
  • Traversal: Access each data item exactly once so that it can be processed.
    • Traversal is a process to visit all the nodes of a data structure for example of a tree.
    • In some structures like trees, lists all nodes are connected via edges (links) we always start from the root (head) node.
    • There are specific traversal algorithms for data structure, for example, there are three ways to traverse a tree −
      • In-order Traversal
      • Pre-order Traversal
      • Post-order Traversal
  • Searching: Find out the location of the data item if it exists in the given collection of data items.

    Any search is said to be successful or unsuccessful depending upon whether the element is found or not.

  • Sorting: Arranging the data items in some order i.e.. in ascending or descending order in case of numerical data and in dictionary order in case of alphanumeric data.

    Examples include searching a record in database, roll numbers in merit list, a particular telephone number, any particular page in a book etc.

  • Merging: Combining elements of two similar data structures to form a new data structure of the same type, is merging.

Developed by: