Gamma-AN-01.05.2024

Gamma-AN-01.05.2024

Professional Development

15 Qs

quiz-placeholder

Similar activities

coding skills (ISCP 02) Tuesday slot1 (9am - 11:00am) CSE A & C

coding skills (ISCP 02) Tuesday slot1 (9am - 11:00am) CSE A & C

Professional Development

20 Qs

SASI -1st year -DAY5-FN (22.12.23)

SASI -1st year -DAY5-FN (22.12.23)

Professional Development

15 Qs

Sasi-FN-04.05.2024

Sasi-FN-04.05.2024

Professional Development

15 Qs

VCE-ALPHA-18.11.2023-AN

VCE-ALPHA-18.11.2023-AN

Professional Development

15 Qs

SASI -BATCH 3-DAY6-FN(25.11.23)

SASI -BATCH 3-DAY6-FN(25.11.23)

Professional Development

15 Qs

DSBS-AN-29.01.2024

DSBS-AN-29.01.2024

Professional Development

15 Qs

Giving directions

Giving directions

Professional Development

10 Qs

Simple Present & Present Progressive

Simple Present & Present Progressive

Professional Development

16 Qs

Gamma-AN-01.05.2024

Gamma-AN-01.05.2024

Assessment

Quiz

English

Professional Development

Easy

Created by

CCC info@ccc.training

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

For the following question, how will the array elements look like after second pass if sorted using Insertion Sort? 34, 8, 64, 51, 32, 21
8, 21, 32, 34, 51, 64
8, 32, 34, 51, 64, 21
8, 34, 51, 64, 32, 21
8, 34, 64, 51, 32, 21

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?
Insertion sort
Selection sort
Quick sort
Merge sort

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

The way a card game player arranges his cards as he picks them up one by one, is an example of
bubble sort
Selection sort
insertion sort
merge sort

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be
bubble sort
insertion sort
selection sort
Quick sort

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

int binarySearch(int arr[], int left, int right, int target) { if (left <= right) { int mid = left + (right - left) / 2; if (arr[mid] == target) return mid; else if (arr[mid] < target) return binarySearch(arr, mid + 1, right, target); else return binarySearch(arr, left, mid - 1, target); } return -1; } What type of binary search does this code snippet represent?
Iterative binary search
Recursive binary search
Linear search
Exponential search

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

int func(int arr[], int n, int target) { int left = 0; int right = n - 1; while (left <= right) { int mid = left + (right - left) / 2; if (arr[mid] == target) return mid; else if (arr[mid] < target) left = mid + 1; else right = mid - 1; } return -1; } What is the primary purpose of the code snippet?
Sorting an array in ascending order
Searching for a target element in a sorted array
Calculating the sum of elements in an array
Reversing the order of elements in an array

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

int binarySearch(int arr[], int n, int target) { int left = 0; int right = n - 1; while (left < right) { int mid = left + (right - left) / 2; if (arr[mid] == target) return mid; else if (arr[mid] < target) left = mid; else right = mid; } return -1; } What issue or error is present in this code snippet?
There is no issue; the code is correct
The loop condition should be left <= right
The left and right updates should be left = mid + 1 and right = mid - 1
The return value is not correct

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?