Basic CS-Algorithms [Redpine Infotech Placement]: Sample Questions 1 - 2 of 2

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

Question 1

Algorithms

Question

MCQ▾

evaluates 18 then

1. -left associative ⚹ has precedence over-
2. -right associative ⚹ has precedence over-
3. ⚹ left associative - has precedence over ⚹
4. ⚹ right associative - has precedence over ⚹

Which is correct?

Choice (4)

a.

1

b.

3

c.

2

d.

4

d.

Explanation

Given,

Evaluates 18

Then,

- has precedence over ⚹ and it associates from the right.

Question 2

Algorithms
Edit

Describe in Detail

Essay▾

Merge sort problem can be solved using which method.

Explanation

• Merge sort problem can be solved using divide and conquer strategy.
• The problem is divided into smaller sub-problems and each one solved independently.
• When we divide the subprograms into even smaller sub-programs, we reach a stage where no more division is possible.
• Those “atomic” smallest possible sub-programs are then solved.

Merge Sort Problem

• Based on divide and conquer technique.
• First divides the array into equal halves and then combines them in a sorted manner.

Ex

Merge sort, will take an unsorted array as below:

• Divide first equal into two parts.
• Array of 8 items is divided into two array of size 4.
• Does not change sequence of item.
• We divide these two arrays into further equal parts.
• Further divide these array