MindMap Gallery Linked list Scala data structure algorithm self-study tutorial mind map
Linked list Scala data structure algorithm self-study tutorial mind map, underwear has an introduction to data structure (algorithm), linked list (Linked List), and Joseph's problem ideas, welcome to learn.
Edited at 2023-02-24 21:09:27One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
Linked list Scala data structure algorithm self-study tutorial mind map
Introduction to data structures (algorithms)
Data structure is a discipline that studies algorithms
program = data structure algorithm
Linked List
Overview
The nodes of the linked list in the memory are not necessarily continuously distributed. From the logical structure point of view, they are continuous.
Judging from the usage effect, the search speed is slow, so in actual development, tree structures are often used to optimize linked lists (AVL, red-black tree)
Addition and deletion are very efficient
increase
Method 1: Add at the end of the linked list
Create the head node head, which does not store valid data. Its function is to identify the head of the linked list.
Create an auxiliary pointer (variable) to help locate the end of the linked list
Method 2: Join according to size
temp needs to be located at the previous node of the position to be added
Conditions for finding location
Use heroNode.no and temp.next.no to determine
Subtopic 2
delete
In the singly linked list state, locate temp to the previous node of the node to be deleted.
temp.next = temp.next.next
Consider the case where the node to be deleted is not found: temp.next.no = no
change
Define auxiliary variables, find the node, consider the situation where it cannot be found, and give a prompt
check
Define auxiliary variables to help traverse
while, when temp.next == null, the traversal ends
Traverse
while, when temp.next == null, the traversal is completed
Joseph's question
Josephu question
Suppose n people numbered 1, 2,...n sit in a circle, and it is agreed that the person numbered k (1=<k<=n) starts counting from 1, and the person who counts to m comes out of the queue, and the next person The bits start from 1 again, m is dequeued, and so on until everyone is dequeued.
Solutions
One-way linked list, locate the node before the child who wants to leave the circle
temp locates the node before first
Subtopic 3
Subtopic 4