Skip to main content
Chapter 5 of 13
Flashcards

Sorting

CBSE · Class 12 · Computer Science

Flashcards for Sorting — CBSE Class 12 Computer Science. Quick Q&A cards covering key concepts, definitions, and formulas.

45 questions22 flashcards5 concepts
22 Flashcards
Card 1Introduction to Sorting

What is sorting in computer science?

Answer

Sorting is the process of ordering or arranging a given collection of elements in some particular order. We can sort numbers in ascending (increasing) or descending (decreasing) order, strings in alph

Card 2Introduction to Sorting

Why is sorting important in computer science? Give a real-world example.

Answer

Sorting is important because it makes searching much faster and easier. For example, words in a dictionary are sorted alphabetically - imagine trying to find a word's meaning if the dictionary wasn't

Card 3Bubble Sort

What is Bubble Sort and why is it called 'Bubble' Sort?

Answer

Bubble Sort is a sorting algorithm that repeatedly compares adjacent elements and swaps them if they are unordered. It's called 'Bubble' Sort because in each pass, the largest element 'bubbles up' to

Card 4Bubble Sort

How many passes does Bubble Sort make for a list of n elements?

Answer

Bubble Sort makes n-1 passes for a list of n elements. In each pass, it compares adjacent elements and swaps them if needed. After each pass, the largest unsorted element reaches its correct position.

Card 5Bubble Sort

Trace through one pass of Bubble Sort for the list [5, 2, 8, 1]. Show all comparisons and swaps.

Answer

Pass 1: 1. Compare 5 and 2: 5 > 2, so swap → [2, 5, 8, 1] 2. Compare 5 and 8: 5 < 8, no swap → [2, 5, 8, 1] 3. Compare 8 and 1: 8 > 1, so swap → [2, 5, 1, 8] After Pass 1: [2, 5, 1, 8] (largest elemen

Card 6Bubble Sort

Write the basic structure of Bubble Sort algorithm in pseudocode.

Answer

BUBBLESORT(numList, n) Step 1: SET i = 0 Step 2: WHILE i < n REPEAT STEPS 3 to 8 Step 3: SET j = 0 Step 4: WHILE j < n-i-1, REPEAT STEPS 5 to 7 Step 5: IF numList[j] > numList[j+1] THEN Step 6: swap(n

Card 7Selection Sort

What is Selection Sort and how does it work?

Answer

Selection Sort divides the list into two parts: sorted (left) and unsorted (right). In each pass, it finds the smallest element from the unsorted part and swaps it with the leftmost element of the uns

Card 8Selection Sort

How many passes does Selection Sort make for a list of n elements, and why?

Answer

Selection Sort makes n-1 passes for a list of n elements. This is because after n-1 passes, n-1 smallest elements are already in their correct positions, and the nth (largest) element automatically fa

+14 more flashcards available

Practice All

Get detailed flashcards for Sorting

Super Tutor gives you interactive content for every chapter of CBSE Class 12 Computer Science — summaries, quizzes, flashcards, and more.

Try Super Tutor — It's Free

Frequently Asked Questions

What are the important topics in Sorting for CBSE Class 12 Computer Science?

Sorting covers several key topics that are frequently asked in CBSE Class 12 board exams. Focus on the core concepts listed on this page and practise related questions to build confidence.

Start by understanding all key concepts. Practise previous year questions from this chapter. Revise formulas and definitions regularly. Use flashcards for quick revision before the exam.

There are 22 flashcards for Sorting covering key definitions, formulas, and concepts. Use them daily for 10–15 minutes for best results.

Sources & Official References

Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.