Java data structure and algorithm notes summary

Chapter 1 Overview of Data Structures and Algorithms

The relationship between data structure and algorithm

  1. Data structure (data structure) is a discipline that studies the way of organizing data. With a programming language, there is also a data structure. Learning data structure well can write more beautiful and efficient code.
  2. To learn the data structure well, you must think more about how to solve the problems encountered in life and use programs to solve them.
  3. Program = data structure + algorithm
  4. The data structure is the foundation of the algorithm . In other words, if you want to learn the algorithm well, you need to learn the data structure in place.

Application of data structure and algorithm

  1. Road construction problem => minimum spanning tree (weighted value) [data structure] + Primm algorithm
  2. Shortest path problem => graph + Freud algorithm
  3. Tower of Hanoi => branch algorithm
  4. Eight Queens Problem => Backtracking Method
    Summary:
    Simple data structure can be completed,
    difficult data structure and algorithm are needed

Linear structure and nonlinear structure

The data structure includes: linear structure and non-linear structure.

Linear structure

  1. As the most commonly used data structure, linear structure is characterized by a one-to-one linear relationship between data elements
  2. Linear structure has two different storage structures, namely sequential storage structure ( array ) and chain storage structure ( linked list ).
    A linear table stored sequentially is called a sequential table, and the storage elements in a sequential table are continuous.
    A linear table stored in a chain is called a linked list. The storage elements in a linked list are not necessarily continuous. The element nodes store data elements and adjacent elements. Address information
  3. Common linear structures are: arrays, queues, linked lists and stacks, we will explain them in detail later.

Non-linear structure

Non-linear structures include: two-dimensional arrays, multi-dimensional arrays, generalized tables, tree structures, graph structures

Chapter 2 Sparse Arrays and Queues

Chapter 2 Sparse Arrays and Queues

Chapter 3 Linked Lists

The first part of the linked list: adding, deleting, modifying, reversing, merging, etc.

The second part of the linked list: doubly linked list, one-way circular linked list, Joseph's problem, Josephu

Chapter 4 Stack

The first part of the stack (array simulation stack, singly linked list simulation stack, application)

The second part of the stack (prefix, infix, postfix expression (reverse Polish expression))

Chapter 5 Recursion

Recursion (introduction to recursion, maze problem, eight queens problem)

Chapter 6 Sorting Algorithm

Algorithm complexity (time frequency, time complexity introduction calculation, space complexity)

Sorting algorithm basis (bubble sort, selection sort, insertion sort)

Sorting algorithm high-level (Hill sort, quick sort, merge sort)

Java sorting algorithm-radix sort

Chapter 7 Search Algorithm

Java search algorithm (linear search, binary search recursive and non-recursive, interpolation search, Fibonacci search algorithm)

Chapter 8 Hash Table

Hash table (hash table)-add, delete, modify and check

Chapter 9 The Basics of the Tree Structure

Binary tree-add, delete, modify and check

Binary tree (sequential storage binary tree, threaded binary tree)

Chapter 10 Practical Application of Tree Structure

Practical application of tree structure (heap sort, Huffman tree, Huffman tree)

Practical application of tree structure (Huffman tree coding)

Practical application of tree structure (binary sort tree, BST, binary search tree)

Practical application of tree structure (balanced binary tree, AVL tree)

Chapter 11. Multiple Search Trees

Multi-way search tree (learn about it)

Chapter 12 Figures

Graph (, graph creation, depth-first traversal, breadth-first traversal)

Chapter 13 Algorithms Commonly Used by Programmers

Commonly used algorithm-divide and conquer algorithm (Tower of Hanoi)

Commonly used algorithm-dynamic programming algorithm (knapsack problem)

Common algorithms-KMP algorithm (string matching problem, brute force matching algorithm)

Commonly used algorithm-greedy algorithm (set covering problem)

Commonly used algorithms-prim algorithm (road construction problem, minimum spanning tree problem)

Commonly used algorithms-Kruskal algorithm (bus stop problem, minimum spanning tree problem)

Commonly used algorithm-Dijkstra algorithm (shortest path problem)

Commonly used algorithm-Floyd (Floyd) algorithm (shortest path problem)

Commonly used algorithm-horse riding chess board algorithm (knight traveling problem)

to sum up

How to learn Java well? (After reading it, I benefited a lot)

Guess you like

Origin blog.csdn.net/weixin_46168350/article/details/108928617