- August 17, 2021
This original question can be handled from https://leetcode.com/problems/second-highest-salary/
Write a SQL query to get the second highest salary from the Employee table.+----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +----+--------+
For example, given the above Employee table, the query should return 200 as the second highest salary. If there is no second highest salary, then the query should return null.+---------------------+ | SecondHighestSalary | +---------------------+ | 200 ...
- August 17, 2021
This question handled from https://leetcode.com/problems/combine-two-tables/
Table: Person+-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName | varchar | | LastName | varchar | +-------------+---------+ PersonId is the primary key column for this table.
Table: Address+-------------+---------+ | Column Name | Type | +-------------+---------+ | AddressId...
The straightforward approach to implementing merging is to design a method that merges two disjoint ordered arrays of Comparable objects into a third array. This strategy is easy to implement: create an output array of the requisite size and then choose successively the smallest remaining item from the two input arrays to be the...
This sorting algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order. This algorithm is not suitable for large data sets as its average and worst case complexity are of ?(n2) where?n?is the number of items.
Although bubble sort is one of...
Quicksort is a divide-and-conquer method for sorting. It works by partitioning an array into two subarrays, then sorting the subarrays independently.
Quicksort is complementary to mergesort: for mergesort, we break the array into two subarrays to be sorted and then combine the ordered subarrays to make the whole ordered array; for quicksort, we rearrange...
To exhibit the value of knowing properties of elementary sorts, we next consider a fast algorithm based on insertion sort. Insertion sort is slow for large unordered arrays because the only exchanges it does involve adjacent entries, so items can move through the array only one place at a time. For example, if the...
The algorithm that people often use to sort bridge hands is to consider the cards one at a time, inserting each into its proper place among those already considered (keeping them sorted). In a computer implementation, we need to make space to insert the current item by moving larger items one position to the...
- December 30, 2020
Selection sort is the one of the well known sorting algorithms. This sorting algorithm is an in-place comparison-based algorithm in which the list is divided into two parts, the sorted part at the left from small to large values and the unsorted part at the right end. At first, the sorted part is empty array/list...
- June 08, 2020
In this blog, we can see all git commands necessary for developers such as config, init, clone, add, commit, diff, reset, status, rm, log, branch, show, tag, checkout, push, pull, remote stash and so forthgit config
This command sets the author name and email address respectively to be used with your commits.
Usage:?git config ?global user.name ?[name]?
- May 01, 2020
The MySQL Docker images maintained by the MySQL team are built specifically for Linux platforms. Other platforms are not supported, and users using these MySQL Docker images on them are doing so at their own risk. If you have MySQL installed and running locally on your laptop, I suggest that you stop it before creating...