• +91 9723535972
  • info@interviewmaterial.com

Data structure Interview Questions and Answers

Data structure Interview Questions and Answers

Question - 41 : - What does each entry in the Link List called?

Answer - 41 : - Each entry in a linked list is called a node. Think of a node as an entry that has three sub entries. One sub entry contains the data, which may be one attribute or many attributes. Another points to the previous node, and the last points to the next node. When you enter a new item on a linked list, you allocate the new node and then set the pointers to previous and next nodes.

Question - 42 : - What is Linked List ?

Answer - 42 : - Linked List is one of the fundamental data structures. It consists of a sequence of? nodes, each containing arbitrary data fields and one or two (”links”) pointing to the next and/or previous nodes. A linked list is a self-referential datatype because it contains a pointer or link to another data of the same type. Linked lists permit insertion and removal of nodes at any point in the list in constant time, but do not allow random access.

Question - 43 : - What member function places a new node at the end of the linked list?

Answer - 43 : - The appendNode() member function places a new node at the end of the linked list. The appendNode() requires an integer representing the current data of the node.

Question - 44 : - How is any Data Structure application is classified among files?

Answer - 44 : - A linked list application can be organized into a header file, source file and main application file. The first file is the header file that contains the definition of the NODE structure and the LinkedList class definition. The second file is a source code file containing the implementation of member functions of the LinkedList class. The last file is the application file that contains code that creates and uses the LinkedList class.

Question - 45 : - Which file contains the definition of member functions?

Answer - 45 : - Definitions of member functions for the Linked List class are contained in the LinkedList.cpp file.

Question - 46 : - What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.

Answer - 46 : - 1. RDBMS Array (i.e. Array of structures) 2. Network data model Graph 3. Hierarchical data model Trees.

Question - 47 : - Difference between calloc and malloc ?

Answer - 47 : - malloc: allocate n bytes calloc: allocate m times n bytes initialized to 0

Question - 48 : - What are Binary trees?

Answer - 48 : -

A binary Tree is a special type of generic tree in which, each node can have at most two children. Binary tree is generally partitioned into three disjoint subsets, i.e. the root of the node, left sub-tree and Right binary sub-tree.

Question - 49 : - Define the tree data structure.

Answer - 49 : -

The Tree is a recursive data structure containing the set of one or more data nodes where one node is designated as the root of the tree while the remaining nodes are called as the children of the root. The nodes other than the root node are partitioned into the nonempty sets where each one of them is to be called sub-tree.

Question - 50 : - List the types of tree.

Answer - 50 : -

There are six types of tree given as follows.

  • General Tree
  • Forests
  • Binary Tree
  • Binary Search Tree
  • Expression Tree
  • Tournament Tree


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners