The following is a list of common algorithms with their time complexities:
Author: Shubhrendu T
Time Complexity of Insertion SortThe worst-case time complexity of the Insertion sort is O(N^2)The average case time complexity of the Insertion sort is O(N^2)The time complexity of the best case is O(N).Space Complexity of Insertion SortThe auxiliary space complexity of Insertion Sort is O(1)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. function insertionSort(arr, n) { let i, key, j; for (i = 1; i = 0 && arr[j] > key) { arr[j + 1] = arr[j]; j = j – 1; } arr[j + 1] = key; } }
Sometimes it is quick and easy to run snippet code to test something before adding it to your project code base. The following is a list of playgrounds that are very useful: React Angular TypeScript MongoDB Flutter Vue Python Spotify Google Doc Google Sheet
Creational Patterns Abstract Factory Builder Factory Method Prototype Singleton Behavioral Patterns Chain of Responsibility Command Interpreter Mediator Memento Observer State Strategy Template Method Visitor Structural Patterns Adapter Bridge Composite Decorator Facade Flyweight Proxy
To convert a WEBP image to PNG or JPG, following the steps below: (1) Install the ‘webp’ tool # apt update # apt install webp (2) Convert input.webp to file2.png $ dwebp input.webp -o file2.png And you’re done!
macOS macOS is a Unix-like operating system build by Apple Inc. It is the main operating system for Mac computers. The core of macOS uses the Darwin kernel. Version History
Audio/Video editing is an important aspect of working nowadays. Especially as more and more people start working from home, there are expectations of online videos in forms of tutorials etc to help communicate what work needs to be done. The following command will extract audio into the specified AAC file. ffmpeg -i inputfile.mkv -vn -acodec copy outputfile.aac After that, to convert the AAC file to a MP3 file use the following command below: ffmpeg -i outputfile.aac -acodec libmp3lame outputfile.mp3 If for any reason, details of a media file can be obtained by: ffprobe inputfile.m4v
Screenshots are very useful during App development as they are useful means of communicated what should be changed or how it should be changed. Marking them up helps Developers and Designers to communicate effectively between them. The command below captures a screen on an Android device and saves it on the laptop/desktop in the file called ‘file.png’. $ adb exec-out screencap -p > file.png
To quickly see the version of a Windows installation, do the following: (1) Windows Key + R(2) Type the following into the Run dialog: winver This will the run a utility which will display the Windows version, Build info and other details, as shown below:
scrcpy (“screen copy”) is a great utility for displaying and controlling an Android device through a USB connection. No root access is required. It is free and open source software. There are many options built into scrcpy and are very useful. The following command starts scrcpy for a particular device (if multiple Android phones are connected via USB): $ scrcpy –serial 461100aabcd90df -S The -S option is for turning the device screen off while mirroring on start.The serial number is obtained using the following command: $ adb devices