1️⃣0️⃣ List Sorting Techniques

Let's explore 10 famous sorting techniques through this introductory of Data Structures and Algorithms (DSA) series.

🧵 👇
We will discuss about

1️⃣ Bubble Sort
2️⃣ Selection Sort
3️⃣ Insertion Sort
4️⃣ Merge Sort
5️⃣ Quick Sort
6️⃣ Counting Sort
7️⃣ Radix Sort
8️⃣ Bucket Sort
9️⃣ Heap Sort
1️⃣0️⃣ Shell Sort

1️⃣ Bubble Sort

✪ Compare 2 consecutive elements. Swap if 1st one is larger than 2nd one.

✪ At the end of each iteration, largest element in the list bubbles up to the top of the list.
2️⃣ Selection Sort

✪ The list is scanned for the smallest element.

✪ At the end of each iteration, this smallest element is swapped with the first element in the list.
3️⃣ Insertion Sort

✪ An element in the list is picked and compared with all other elements prior to it in a reverse order.

✪ If the element is smaller than the compared element, later is shifted to right. Or else the element is inserted next to the compared element.
4️⃣ Merge Sort

It uses Divide-and-Conquer and Recursions.

✪ A list is divided in 2 equal halves. Each half goes for a recursion (calling same function).

✪ It is expected to receive 2 sorted sub lists at the end of recursion

✪ Merge 2 sorted sub lists for a full sorted list
5️⃣ Quick Sort

It uses Divide-and-Conquer and Recursions

✪ A pivot element is chosen and checked for an appropriate position in the list so that smaller elements are left to it and larger elements are right to it

✪ The left and right sub lists do the same through recursion
6️⃣ Counting Sort

✪ The list is scanned for the maximum element

✪ Another list (count list) is created of size (max element + 1) with all 0s.

✪ The list is traversed and count list is updated accordingly with appropriate count.

✪ Based on counts, list is sorted.
7️⃣ Radix Sort

✪ Find the max value in the list. Find out how many digits it has.

✪ Starting from units, then to tens and hundreds etc arrange the elements based on sorted numbers in that digit place.
8️⃣ Bucket Sort

It uses Scatter-Gather approach

✪ First a bucket list is created. Each bucket in the list can contain elements of certain range.

✪ Elements are scattered to buckets

✪ Each bucket is sorted (other sorting technique)

✪ Elements from all buckets are gathered
9️⃣ Heap Sort

It uses heap data structure.

✪ Elements are kept in heap either in Min-Heap or, Max-Heap.

✪ The root is swapped with the right most child node and, then removed from the heap.

✪ Then the heap is heapified and this process continues till the heap is empty.
1️⃣0️⃣ Shell Sort

✪ It uses insertion sort mechanism. But instead of scanning elements one-by-one, it uses a sequence.

Example of a sequence: N/2, N/4, N/8 where N is size of list.

✪ So after each iteration, elements at particular intervals (based on sequence) are sorted.
That's it guys.

All these sorting techniques will individually be described in a 🧵 as part of DSA series. It will be explained both in written and visual format.

Stay tuned for the upcoming threads in this series.

See you soon 👋

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda ✨

Swapna Kumar Panda ✨ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

19 Oct
7️⃣5️⃣ Numeric Problems to strengthen your *COMPETITIVE CODING* skill

✪ Are you planning to be a competitive coder?
✪ But not sure how to start?

Don't worry. Here are 75 numeric problems that will certainly improve your competitive coding skill.

Problems listed 👇
1️⃣ Number

1️⃣ Find a digit at a specific place in a number
2️⃣ Find count of digits in a number
3️⃣ Find the largest digit
4️⃣ Find the 2nd largest digit
5️⃣ Find the smallest digit
6️⃣ Find the 2nd smallest digit
7️⃣ Find generic root (sum of all digits) of a number

++
8️⃣ Reverse the digits in a number
9️⃣ Rotate the digits in a number
1️⃣0️⃣ Is the number a palindrome?
1️⃣1️⃣ Find the binary, octal and hexadecimal equivalent
1️⃣2️⃣ Convert a binary, octal and hexadecimal to a decimal
1️⃣3️⃣ Find sum of 'n' numbers

++
Read 13 tweets
17 Oct
4️⃣ CRUD Operations described wrt SQL, REST API and UI

🧵 👇
0️⃣ Introduction

CRUD stands for Create, Read, Update and Delete.

These are the 4 basic operations of persistent storage.

The term CRUD is also used for Database and UI.

Let's explore these 👇
1️⃣ C for Create

SQL: INSERT into TABLE_NAME VALUES (V1, V2, V3)

REST HTTP Method: POST

UI Form: User Sign Up, Creating a Blog Post etc.
Read 7 tweets
17 Oct
😊 Are you a beginner in programming domain?

😢 Are you getting confused of what approach to take while solving a problem?

🙃 Are you wondering why is DSA so important in Problem Solving?

Let's clear all confusions and master the skill through 1️⃣0️⃣ super simple steps 😎

🧵 👇
1️⃣ Read-Realise-Write-Run-Reshape

Yes. I say it often when someone asks me how to approach during solving a problem.

Let's see what are these.
1️⃣.1️⃣ Read & Realise

These 2 actions are so close to each other that we can hardly keep apart.

Do like this.

1. When you try to solve a problem, first "Read" it properly once.

2. Then, "Realise" what it is asking to solve.

++
Read 22 tweets
16 Oct
7️⃣5️⃣ Data Structures and Algorithms (DSA) questions

You should be able to master all these in coming days through the upcoming DSA series.

🧵 👇
1️⃣ Algorithms Basics

1️⃣ What is an algorithm?
2️⃣ How to approach to solve a problem?
3️⃣ What is time complexity? How to measure it?
4️⃣ What is space complexity? How to measure it?
2️⃣ Data Structure Basics

5️⃣ What are types of data structures?
6️⃣ What are some mostly used data structure operations?
7️⃣ What is traversal?
8️⃣ How to insert an element?
9️⃣ How to delete an element?
1️⃣0️⃣ How to get an element?
1️⃣1️⃣ How to update an element?
Read 19 tweets
15 Oct
Are you new to Data Structures and Algorithms (DSA)?

Let's get to know about all of those we would be learning.

🧵 👇
1️⃣ Array

👉 Data Structures

1️⃣ One-Dimensional Array
2️⃣ Multi-Dimensional Array

👉 Algorithms

1️⃣ Traverse
2️⃣ Insert
3️⃣ Delete
4️⃣ Get
5️⃣ Search
6️⃣ Size
7️⃣ Reverse
2️⃣ Linked List

👉 Data Structures

1️⃣ Singly Linked List
2️⃣ Doubly Linked List

👉 Algorithms

1️⃣ Traverse
2️⃣ InsertAtHead
3️⃣ InsertAtEnd
4️⃣ Insert
5️⃣ DeleteAtHead
6️⃣ DeleteAtEnd
7️⃣ Delete
8️⃣ Update
9️⃣ Get
1️⃣0️⃣ Search
1️⃣1️⃣ IsEmpty
1️⃣2️⃣ Reverse
Read 13 tweets
13 Oct
🔥 9️⃣ Useful Hacks to simplify your JavaScript code

Follow these simple yet most useful hacks in your code. These are not only modern way of writing JS code but also minifies your code.

🧵 👇
We will cover,

1️⃣ Converting to Boolean
2️⃣ Converting to Number
3️⃣ Converting to String
4️⃣ Short-Circuit && and ||
5️⃣ Default Function Parameters
6️⃣ Nullish Coalescing Operator
7️⃣ Optional Chaining Operator
8️⃣ Array Resizing
9️⃣ Converting Array-Like to Array
1️⃣ Converting to Boolean

To convert any data to a Boolean type, use

→ Boolean function or,
→ !! operator
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(