Computer Science
Assertion. In Insertion Sort, a part of the array is always sorted.
Reason. In Insertion sort, each successive element is picked and inserted at an appropriate position in the sorted part of the array.
Python Data Handling
2 Likes
Answer
(a)
Both Assertion and Reason are true and Reason is the correct explanation of Assertion.
Explanation
Insertion sort is a sorting algorithm that builds a sorted list, one element at a time from the unsorted list by inserting the element at its correct position in sorted list. In Insertion sort, each successive element is picked and inserted at an appropriate position in the previously sorted array.
Answered By
2 Likes
Related Questions
Assertion. Dictionaries are mutable, hence its keys can be easily changed.
Reason. Mutability means a value can be changed in place without having to create new storage for the changed value.
Assertion. Dictionaries are mutable but their keys are immutable.
Reason. The values of a dictionary can change but keys of dictionary cannot be changed because through them data is hashed.
What is the internal structure of python strings ?
Write a Python script that traverses through an input string and prints its characters in different lines — two characters per line.