Sherlock Blaze

I bloom in the slaughter, like the flowers of the dawn

Growth Of Function

You can read the MindNode first. ...

Loop Invariants

What is Loop Invariants At the start of each iteration of the for loop, the subarray A[i..j-1] consists of the elements originally in A[1..j-1], but in sorted order.We use loop invariants to help u......

Add Two Numbers

QuestionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers a......

Two Sum

QuestionGiven an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use......

Replace All Spaces

QuestionImplement a function that replaces each space in the string with “%20”.For example: Input: “Sherlock Blaze is the most handsome boy in this world”Output: “Sherlock%20Blaze%20is%20the%20most......

Insertion-Sort

Know about it by writing CODE. Because it’s really easy!!!! Pseudocode12345678for j = 2 to A.length key = A[j] // Insert A[j] into the sorted sequence A[1...j-1] i = j - 1 while i > 0 and A[......

Queue

Extracted from the book. Like stacks, queue are lists. With a queue, however, insertion is done at one end, whereas deletion is performed at the other end. Just like people are waiting in line. Sti......

Stack

A stack is a list with the restriction that insertions and deletions can be performed in only one position. We call this behavior last in first out(LIFO), and the position, we call it top, top of a......

Doubly LinkedList

Sometimes it’s convenient to traverse lists backwards. We just add an extra field to the data structure, containing a pointer to the previous node. Here is what Doubly LinkedList looks like. In my......

ArrayList

Now let’s talk about arraylist, we know it costs O(n) when you want access a value at the index you give by using a linkedlist, if you want make it faster to finish, you should use arraylist, it co......