0% found this document useful (0 votes)
5 views3 pages

Tutorial 4 Set 1

The document outlines the course structure for a B. Tech core course on Data Structures and Algorithms using C++, detailing specific learning outcomes and objectives. It includes a tutorial section with questions categorized by difficulty level, focusing on sorting algorithms and their complexities. The course aims to enhance students' understanding and practical skills in data structures and algorithmic problem-solving.

Uploaded by

gauravtaneja366
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Tutorial 4 Set 1

The document outlines the course structure for a B. Tech core course on Data Structures and Algorithms using C++, detailing specific learning outcomes and objectives. It includes a tutorial section with questions categorized by difficulty level, focusing on sorting algorithms and their complexities. The course aims to enhance students' understanding and practical skills in data structures and algorithmic problem-solving.

Uploaded by

gauravtaneja366
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

School of Computer Science Engineering and Technology

Course- B. Tech Type- Core Course


Code- CSET243 Course Name-DSA using C++
Year- 2024 Semester- 3rd(Odd)
Date-15-08-2024 Batch-
Tutorial: 04

COURSE-SPECIFIC LEARNING OUTCOMES (CO)

CO1: Articulate the design, use and associated algorithms of fundamental and abstract data structures

CO2: Examine various searching and sorting techniques based on complexity analysis for applicative
solutions.

CO3: Demonstrate hands-on experience on implementing different data structures

CO4: Build optimized solutions for real-word programming problems using efficient data structures.

Objective 1: Finding time complexities of the sorting algorithm method.


Objective 2: Finding time complexities using the iterative and recursion tree method.

Tut No. Name CO 1 CO 2 CO 3 CO4


1 Tutorial:4.1 √

Section 1 Easy (3 Questions)


Question 1. Of the following sorting algorithms, which has a running time that is least
dependent on the initial ordering of the input? (4 Mins)
a) Bubble Sort
b) Selection Sort
c) Insertion Sort
d) Merge Sort
Question 2: Given two sorted list of size m and n respectively. The number of comparisons
needed the worst case by the merge sort algorithm will be: (4 Mins)

a) m-n
b) m+n-1
c) max (m, n)
d) min (m, n)

Question 3: Which one of the following in-place sorting algorithms needs the minimum
number of swaps? (4 Mins)

a) Bubble Sort
b) Selection Sort
c) Insertion Sort
d) Merge Sort

Section 2 Medium (3 Questions)


Question 1. Given the following list of numbers: [21, 1, 26, 45, 29, 28, 2, 9, 16, 49, 39, 27, 43,
34, 46, 40] which answer illustrates the list to be sorted after 3 recursive calls to merge-
sort? (10 Mins)

a) [16, 49, 39, 27, 43, 34, 46, 40]


b) [21,1]
c) [21, 1, 26, 45]
d) [21]

Question 2: Suppose you have the following list of numbers to sort: [15, 5, 4, 18, 12, 19, 14,
10, 8, 20] which list represents the partially sorted list after three complete passes of
insertion sort? (10 Mins)
a) [4, 5, 12, 15, 14, 10, 8, 18, 19, 20]
b) [15, 5, 4, 10, 12, 8, 14, 18, 19, 20]
c) [4, 5, 15, 18, 12, 19, 14, 10, 8, 20]
d) [15, 5, 4, 18, 12, 19, 14, 8, 10, 20]

Question 3: Suppose you have the following list of numbers to sort: [11, 7, 12, 14, 19, 1, 6,
18, 8, 20] which list represents the partially sorted list after three complete passes of
selection sort? (10 Mins)
a) [7, 11, 12, 1, 6, 14, 8, 18, 19, 20]
b) [7, 11, 12, 14, 19, 1, 6, 18, 8, 20]
c) [11, 7, 12, 14, 1, 6, 8, 18, 19, 20]
d) [11, 7, 12, 14, 8, 1, 6, 18, 19, 20]
Section 3 Hard (2 Questions)
Question 1: If one uses straight two-way merge sort algorithm to sort the following
elements in ascending order: [20, 47, 15, 8, 9, 4, 40, 30, 12, 17] then the order of these
elements after second pass of the algorithm is: [15 mins]

a) 8,9, 15, 20, 47, 4, 12, 17, 30, 40


b) 8, 15, 20, 47, 4, 9, 30, 40, 12, 17
c) 15, 20, 47, 4, 8, 9, 12, 30, 40, 17
d) 4, 8, 9, 15, 20, 47, 12, 17, 30, 40.

Question 2: Suppose we want to arrange the n numbers stored in an array such that all
negative values occur before all positive ones. The minimum number of exchanges required
in the worst case is [15 mins]
a) n–1
b) n
c) n+1
d) None of the above

Question 3: Find the big-O time complexity of each of the following code fragments:

a) for (int i = 0; i < n; i++) // loop 1


for (int j = i+1; j > i; j--) // loop 2
for (int k = n; k > j; k--) // loop 3
System.out.println("*");

b) void foo(int n){


if (n <= 1)
return;
doOhOne(); // doOhOne() runs in O(1) time
foo(n/2);
foo(n/2);
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy