迹忆客 EN >

所有文章

Convert a binary tree to a binary search tree

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A binary tree is a non-linear data structure. It is called a binary tree because each node has at most two children. These children are called left and right children. It can also be interpreted as an undirected graph where the topmost node...

查看全文

In-order descendants in a binary search tree

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

The in-order descendant of a binary tree is the next node in the in-order traversal of the binary tree. So, for the last node in the tree, it is NULL . Since the in-order traversal of a binary search tree is a sorted array. The node with th...

查看全文

Binary Search Tree Deletion

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

In the article Binary Search Trees: Searching and Inserting , we discussed how to insert an element into a binary search tree and how to search for a value in a binary search tree. In this article, we will discuss how to delete a node from...

查看全文

Binary Search Tree Check

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A binary tree is a non-linear data structure. It is called a binary tree because each node has at most two children. These children are called left children and right children. For a binary tree to be a BST, it must satisfy the following pr...

查看全文

Iterative insertion into a binary search tree

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

In the previous article Binary Search Tree , we discussed the recursive method to insert a node in BST. In this article, we will discuss the iterative method to insert a node in BST. It is better than the recursive method because the iterat...

查看全文

Binary Search Tree

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A binary search tree (BST) is an ordered binary tree data structure based on nodes. A node has a value and two child nodes (a binary tree has at most two child nodes) connected to each other. A node has a value and two child nodes (a binary...

查看全文

Binary Tree Traversal

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A binary tree is a non-linear data structure. It is called a binary tree because each node has at most two children. These children are called left and right children. It can also be interpreted as an undirected graph where the topmost node...

查看全文

Circular Doubly Linked List

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A circular doubly linked list is a combination of a circular linked list and a doubly linked list. Its two nodes are connected by a previous and next pointer. The next pointer of the last node points to the first node, and the previous poin...

查看全文

Circular Linked List

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A circular linked list is a data structure that is slightly more complex than a linked list. It is a linked list where all the nodes are connected in a loop and form a chain. The last node does not have a NULL . Instead, it stores the addre...

查看全文

Doubly Linked List

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

Doubly linked list is a linear data structure. It is a collection of objects defined as nodes. But unlike a linked list, the node has two pointers, one is the previous pointer and the other is the next pointer. Just like the linked list nod...

查看全文

Link list deletion

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

In this article, we will learn how to delete a node from a linked list. Linked list deletion algorithm Let head be a pointer to the first node of the linked list and let temp be the value of the node to be deleted from the linked list. Iter...

查看全文

Linked List Merge Sort

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

In this article, we will learn how to sort a linked list using merge sort algorithm. It is one of the most preferred algorithms to sort a linked list because slow pointer random access makes the performance of other algorithms worse (for ex...

查看全文

Linked list reversal

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

A linked list is a linear data structure. A node in a linked list consists of: Data item. The address of the next node. class Node { int data; Node * next; }; This article will show you how to reverse a linked list given a pointer to the he...

查看全文

Linked list insertion

发布时间:2025/03/18 作者:JIYIK 分类:ALGORITHM

In this article, we will learn how to insert a node into a linked list. We can see that 4 different cases occur. We want to insert a node before the head of the linked list. This operation is similar to the push operation in a stack. We wan...

查看全文

扫一扫阅读全部技术教程

社交账号
  • https://www.github.com/onmpw
  • qq:1244347461

热门文章

热门标签

扫码一下
查看教程更方便