Skip to content

algorithm implement of commons,interview for corporation and leetcode etc.

License

Notifications You must be signed in to change notification settings

dtera/algorithm

Repository files navigation

In mathematics and computer science, an algorithm is an unambiguous specification of how to solve a class of problems. Algorithms can perform calculation, data processing and automated reasoning tasks.

As an effective method, an algorithm can be expressed within a finite amount of space and time and in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.

The concept of algorithm has existed for centuries, and the use of the concept can be ascribed to Greek mathematicians, e.g. the sieve of Eratosthenes and Euclid's algorithm; the term algorithm itself derives from the 9th Century mathematician Muḥammad ibn Mūsā al'Khwārizmī, latinized 'Algoritmi'. A partial formalization of what would become the modern notion of algorithm began with attempts to solve the Entscheidungsproblem (the "decision problem") posed by David Hilbert in 1928. Subsequent formalizations were framed as attempts to define "effective calculability" or "effective method"; those formalizations included the Gödel–Herbrand–Kleene recursive functions of 1930, 1934 and 1935, Alonzo Church's lambda calculus of 1936, Emil Post's Formulation 1 of 1936, and Alan Turing's Turing machines of 1936–7 and 1939.

This is commons algorithm implement, such as sort, find etc.

This is corporation interview algorithm implement, such as alibaba, tencent, baidu etc.

The number of LeetCode questions is increasing every week. For more questions and solutions, you can see my Algorithm repository. I'll keep updating for full summary and better solutions. Stay tuned for updates. (Notes: "📖" means you need to subscribe to LeetCode premium membership for the access to premium questions.)

The Pointing Offer.

Alibaba

# Title Solution Time Space Difficulty Tag Note

Tencent

# Title Solution Time Space Difficulty Tag Note

Baidu

# Title Solution Time Space Difficulty Tag Note

Huawei

# Title Solution Time Space Difficulty Tag Note

Jingdong

# Title Solution Time Space Difficulty Tag Note

Netease

# Title Solution Time Space Difficulty Tag Note

Bytedance

# Title Solution Time Space Difficulty Tag Note

Bit Manipulation

# Title Solution Time Space Difficulty Tag Note
461 Hamming Distance Java O(1) O(1) Easy

Array

# Title Solution Time Space Difficulty Tag Note
561 Array Partition I Java O(r) O(r) Easy
832 Flipping an Image Java O(n^2) O(1) Easy
867 Transpose Matrix Java O(1) O(1) Easy

String

# Title Solution Time Space Difficulty Tag Note
657 Judge Route Circle Java O(n) O(1) Easy
709 To Lower Case Java O(n) O(1) Easy
804 Unique Morse Code Words Java O(n) O(n) Easy

Linked List

# Title Solution Time Space Difficulty Tag Note
876 Middle of the Linked List Java O(n) O(1) Easy

Stack

# Title Solution Time Space Difficulty Tag Note

Heap

# Title Solution Time Space Difficulty Tag Note

Tree

# Title Solution Time Space Difficulty Tag Note
617 Merge Two Binary Trees Java O(n) O(h) Easy

Hash Table

# Title Solution Time Space Difficulty Tag Note
771 Jewels and Stones Java O(m + n) O(n) Easy
888 Uncommon Words from Two Sentences Java O(m + n) O(m + n) Easy

Math

# Title Solution Time Space Difficulty Tag Note
728 Self Dividing Numbers Java O(n) O(1) Easy
887 Projection Area of 3D Shapes Java O(n^2) O(1) Easy

Two Pointers

# Title Solution Time Space Difficulty Tag Note

Sort

# Title Solution Time Space Difficulty Tag Note

Recursion

# Title Solution Time Space Difficulty Tag Note

Binary Search

# Title Solution Time Space Difficulty Tag Note
852 Peak Index in a Mountain Array Java O(logn) O(1) Easy

Binary Search Tree

# Title Solution Time Space Difficulty Tag Note

Breadth-First Search

# Title Solution Time Space Difficulty Tag Note

Depth-First Search

# Title Solution Time Space Difficulty Tag Note

Backtracking

# Title Solution Time Space Difficulty Tag Note

Dynamic Programming

# Title Solution Time Space Difficulty Tag Note

Greedy

# Title Solution Time Space Difficulty Tag Note

Graph

# Title Solution Time Space Difficulty Tag Note

Design

# Title Solution Time Space Difficulty Tag Note

SQL

# Title Solution Time Space Difficulty Tag Note

Shell Script

# Title Solution Time Space Difficulty Tag Note

About

algorithm implement of commons,interview for corporation and leetcode etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published