TCS Papers: Sample Questions 270 - 270 of 502

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

Question number: 270

» Basic CS » Data Structures

Essay Question▾

Describe in Detail

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.