Basic CS [TCS Placement]: Sample Questions 171 - 172 of 196

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 171

Edit

Describe in Detail

Essay▾

What is Common Type System (CTS) ?

Explanation

  • CTS is the CLR component which allows support for multiple languages through a type system common across all the languages.
  • Two CTS-compliant languages do not require type conversion when calling the code written in one language from within the code written in another language.
  • CTS provide a base set of data types for all the languages supported by. NET Framework.
  • That is size of integer and long variables is same across all . NET-compliant programming languages.
  • Each language internally uses aliases for the base data types provided by CTS.
  • For example, CTS uses the data type system. int32 to represent a 4 byte integer value- Visual Basic uses the alias integer for the same and C# uses the alias int.
Given the Image is Define the Common Type System (CTS)

Question 172

Edit

Describe in Detail

Essay▾

In an AVL tree, at what condition the balancing is to be done?

Explanation

  • AVL tree is a self-balanced binary search tree. Named after their inventor Adelson, Velski, & Landis, AVL trees are height balancing binary search tree.
  • That means, an AVL tree is also a binary search tree but it is a balanced tree.
  • Balance factor of each node is passed on the path to an insertion to predict the nodes that go out of balance and determine the nodes closest to the insertion point. This node is called pivot node.
  • AVL tree checks the height of the left and the right sub-trees at the point of insertion and assures that the difference is not more than 1. This difference is called the “Balance Factor” .
  • If the difference in the height of left and right sub-trees is more than 1, the tree is balanced using rotation as
Given the Image is Define the Binary Search Tree and Every Node is Satisfying Balance Factor Condition. So this is Said to be an AVL Tree
Given the Image is Define the AVL Tree After Rotations

Developed by: