Dynamic Programming
Dynamic ProgrammingDynamic programming is a method for solving complex problems by breaking them down into simpler subproblems, storing the results of those subproblems to avoid redundant work. It is particularly useful for optimization problems where the solution can be expressed as a combination of solutions to subproblems. Fibonacci SequenceThe Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1. The nth Fibonacci ...
Search
SearchSearch is a fundamental operation in computer science that involves finding a specific element or value within a data structure. There are various search algorithms, each with its own advantages and disadvantages depending on the context and the type of data structure being used. Some common search algorithms include: Linear Search: This algorithm checks each element in the data structure sequentially until it finds the target element or reaches the end of the structure. It has a time ...
Divide and Conquer Algorithm
Divide and Conquer AlgorithmHanota TowerThe Hanota Tower, also known as the Tower of Hanoi, is a mathematical puzzle that consists of three rods and a number of disks of different sizes. The objective is to move the entire stack of disks from one rod to another, following these rules: Only one disk can be moved at a time. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack or on an empty rod. No disk may be placed on top of a smaller disk...
Sort
SortStable Sort: Stable sort is a sorting algorithm that preserves the relative order of equal elements in the sorted output.Local Sort: Local sort is a sorting algorithm that sorts elements in a small region of the list. Bubble SortBubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. Stable Sort: YesLocal Sort: Yes 12Time compl...
Regular Expression Conception
Regular Expression ConceptionA regular expression (regex) is a sequence of characters that defines a search pattern. It is commonly used for string matching and manipulation in various programming languages and tools. Regular expressions allow you to search for specific patterns in text, such as email addresses, phone numbers, or any other string format.Example:12# A regex pattern to match email addresses^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ Regular Expression SyntaxBasic...
Shell Conception
Shell ConceptionA shell is a command-line interface that allows users to interact with the operating system. It provides a way to execute commands, run scripts, and manage files and processes. The shell acts as an intermediary between the user and the operating system, interpreting user input and executing the corresponding commands. 12345678cat /etc/shells# List of valid login shells:/bin/sh/bin/bash/bin/rbash/bin/dash/bin/zsh/bin/ksh example:1234# Check the current shellecho $SHELL # Change...
Python - Basic Syntax Cheat Sheet
Python Basic Syntax Cheat SheetA concise reference for Python beginners and developers coming from languages like JavaScript, Java, or C++. 1. Variables & Data Types12345678x = 10 # inty = 3.14 # floatname = "Alice" # stringis_valid = True # booleanitems = [1, 2, 3] # listdata = {"a": 1} # dictnums = (1, 2, 3) # tupleunique = {1, 2, 3} # set Type Checking12type(x) # <class 'int'>isins...
Greedy Algorithms
Greedy AlgorithmsGreedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum. They are often used for optimization problems where the solution can be built incrementally by making a series of choices. Maximun SwapMaximum Swap CandyCandy
MySQL Index
MySQL IndexIndexes are data structures that improve the speed of data retrieval operations on a database table at the cost of additional storage space and maintenance overhead. In MySQL, indexes are used to quickly locate and access the data in a table without having to scan the entire table. There are several types of indexes in MySQL, including: B-Tree Indexes: This is the most common type of index in MySQL. It organizes the data in a balanced tree structure, allowing for efficient searchi...
MySQL Storage Engine
MySQL Storage EngineMySQL supports multiple storage engines, each with its own features and use cases. The most commonly used storage engines are InnoDB and MyISAM. InnoDB: This is the default storage engine in MySQL. It supports transactions, foreign keys, and row-level locking, making it suitable for high-concurrency applications. InnoDB is designed for reliability and performance, and it is the recommended storage engine for most applications. MyISAM: This storage engine is older and does...





