02 October 2021
AVL trees named after three inventors Adelson-Velsky-and Landis, is a type of self balancing binary search tree.
28 September 2021
A balanced binary tree or a height-balanced tree is a tree in which the height of the left and right subtree at any node does not differ by more than one. Not just the root node, at any node. Mathematically...
21 September 2021
Trie, also known as prefix tree or digital tree, is an advanced tree data structure that makes data retrieval operations more efficient.
29 June 2021
If you have different personal and work GitHub accounts and are trying to use SSH-based authentication for both of them chances are you will face some errors. In this article, I will show you how to do...
18 May 2021
We live in an age when we are surrounded by technology and ads and tons of internet content. But even in this age there exist a part of the internet, a part of the society rather, that remains hidden from...
02 April 2021
A server is just a computer. It is nothing different than the computer you use in terms of definition though it might differ in terms of the task it performs and the amount of power it has. A server is...
22 March 2021
The Floyd's tortoise and hare algorithm is used to detect a cycle in a linked list. LL cycle can be found using a hash set but tortoise and hare algorithm is better in terms of space complexity.
19 March 2021
You have an internet connection. But what is an “internet connection” anyway? What is mobile data? What are WiFi, LAN, DNS, IP address, ISP, and lots of other jargon that you use or just ignore when you...
16 March 2021
What is a captcha? Why do websites use them? What do websites ask me if I am a robot?CAPTCHA is a type of challenge-response test used....
12 March 2021
Multitasking, in an operating system, is allowing a user to perform more than one task at a time. Multitasking is achieved by the CPU by switching between the tasks so fast that appear to be running simultaneously.
28 February 2021
implement FreqStack, a class which simulates the operation of a stack-like data structure.FreqStack has two functions:push(int x), which pushes an integer x onto the stack.pop(), which removes and returns...
27 February 2021
Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. Return the quotient after dividing dividend by divisor. The integer division should...
26 February 2021
Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack.
25 February 2021
Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest...
25 February 2021
Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B are balanced parentheses strings. (A) has score 2 *...
23 February 2021
Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers...
22 February 2021
Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return...
21 February 2021
On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; Decrement: Subtract 1 from the number on the display. Initially,...
20 February 2021
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Given a roman numeral, convert it to an integer.
19 February 2021
Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid...
18 February 2021
A zero-indexed array A consisting of N numbers is given. A slice of that array is any pair of integers (P, Q) such that 0
17 February 2021
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find...
16 February 2021
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string.
15 February 2021
Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest rows in the matrix ordered from the weakest to the strongest.
14 February 2021
There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally,...
13 February 2021
In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that:...
12 February 2021
Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.
11 February 2021
Given two strings s and t , write a function to determine if t is an anagram of s.
10 February 2021
A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null.Construct a deep copy of ...
09 February 2021
Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.
08 February 2021
Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that supports the peek() operation -- it essentially peek() at the element that will be returned...
07 February 2021
Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the shortest distance from s[i] to the character c in s.
05 February 2021
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
05 February 2021
Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path.
21 January 2021
SQL WITH PYTHON - THE COMPLETE GUIDE | FOR UBUNTU USERS
25 September 2020
You must have heard about Darwin’s theory of evolution and natural selection. Genetic Algorithms are basically an effort to imitate the same, artificially. A genetic algorithm is a randomized search that...
06 September 2020
The C++ STL (Standard Template Library) is a powerful set of C++ template classes to provide general-purpose functions with templates that implement many popular and commonly used algorithms.
30 July 2020
8 computer science concepts a beginner programmer must know to bridge the gap between having absolutely no idea and being a beginner in coding.