3i Infotech Placement: Sample Questions 399 - 401 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 399

Edit

Describe in Detail

Essay▾

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

Explanation

  • In an AVL tree, if the balance height is greater than 1 or less than 1 balancing is done.
  • AVL tree is a self-balancing binary search tree.
  • The balance height of left and right sub trees cannot be more than one for all nodes.

AVL Rotations

Left rotation

The Left Rotation

Right rotation

The Right Rotation

Left-Right rotation

Left-Right Rotation

Right-Left rotation

Right-Left Rotation

Question 400

Write in Short

Short Answer▾

Brace used in c for what

Explanation

  • Brace used in c for convention.
  • It is used to create a body.
  • The opening brace indicates the start of a segment with the closing brace indicating the end segment.
  • Many opening braces as closing braces.

Question 401

Question

MCQ▾

REPLACE ( ‘JACK AND JUE’ , ‘J’ , ‘BL’ ) will return

Choices

Choice (4)

a.

BLACK AND JACK

b.

BLACK AND BLUE

c.

JACK AND BLUE

d.

All of the above

Answer

b.

Explanation

  • REPLACE function replaces a sequence of characters in a string with another set of characters.
  • replacement_string is omitted or null, then all search_string are removed.
  • search_string is null, then char is return.

Syntax:

REPLACE (string1, string_to_replace [, replacement_string] )

EX:

REPLACE ( ‘JACK AND JUE’ , ‘J’ , ‘BL’ )

J = search_string

BL = replacement_string

So, JACK = BLACK

JUE = BLUE

So, return string is BLACK AND BLUE

Developed by: