Companies Home Search Profile

Interview Prep: Insertion Sort

Focused View

Edaqa Mortoray

23:07

98 View
  • 1. Introduction.mp4
    00:33
  • 2. Algorithm Design.mp4
    04:46
  • 3. Algorithm Complexity.mp4
    03:43
  • 4. Verify Sort Algorithm.mp4
    04:49
  • 5. Insert Sort Code.mp4
    03:31
  • 6. Stable Sort.mp4
    02:34
  • 7. Verify Sort Code.mp4
    02:54
  • 8. Conclusion.mp4
    00:17
  • More details


    Description

    Insertion sort is a commonly taught algorithm, and some interviewers like to ask about it. As you’ll see in this class, it’s an easy algorithm to understand and implement. You’ll learn the algorithmic complexity and understand why the algorithm is rarely used.

    I’ll give a walkthrough of the source code, which I also provide in my repository: github.com

    Also watch my course on Binary Search, insertion sort makes use of that algorithm.

    Project

    I want you to write an insertion sort function. Choose your favorite language, or the one for your interview, and implement a function that sorts a list of values. Use the algorithm I present in this class.

    In the example Python implementation, the signature looks like this:

    ```py
    def insertion_sort( items : List[ComparableT] ) -> List[ComparableT]:
    ```

    Verify Sort Algorithm

    As a bonus project, write the verify sort algorithm. This is an essential bit of code for unit tests. It also explores concepts that will help you during your interviews.

    Verify sort takes an unsorted list and a sorted list. It verifies that the sorted list is indeed the sorted version of the unsorted one.

    User Reviews
    Rating
    0
    0
    0
    0
    0
    average 0
    Total votes0
    Focused display
    Edaqa Mortoray
    Edaqa Mortoray
    Instructor's Courses
    Hi, I'm Edaqa, a programmer, writer and chef. For over 20 years, I've been following a diverse and exciting career path. My journey traces through several countries, filled with great people and culture. I've dedicated my time to numerous startups, and an abundance of side projects. There's so much I'd like to share with all with you -- from programming to cooking, to the unusual creative endeavours. I want my classes to give you the confidence you need to succeed, and the curiosity required to make the most of life. Join me in my continuing adventures.
    Learn Web Design & Development with SitePoint tutorials, courses and books - HTML, CSS, JavaScript, PHP, Responsive Web Design.
    • language english
    • Training sessions 8
    • duration 23:07
    • Release Date 2023/09/25