Тёмный
No video :(

Data Structures: Delete a node from N-ary tree | C++ Tutorial 

VDEngineering
Подписаться 30 тыс.
Просмотров 1,7 тыс.
50% 1

In this data structures video you will learn how to delete a node from an n-ary tree using C++. This is a tree in which each node can have more than 2 children. There are four unique cases, the node to be deleted either;
1) Is a leaf node,
2) Has one child,
3) Has many children and you want to promote all of the children.
4) Has many children and you want to promote only one of the children.
You will also learn how to use recursion to search for a node in an n-ary tree using Depth First Search (DFS).
Previous topics covered included deleting a node from a binary tree or binary search tree. This topic is slightly more advanced and is not asked on LeetCode. However, it is relevant to real world projects.
Resources:
~~MyCodeSchool: Deleting a node from a binary search tree: • Delete a node from Bin...
~~Creating an n-ary tree: • Data Structures: Creat...
~~The code for printing a tree in 2D to the screen was taken from: www.geeksforge...
Thanks for watching!
~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning:
www.udemy.com/...
~~Website: www.vinayakd.com/
~~Instagram: / vinayak_desh

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@joeabala2037
@joeabala2037 Год назад
Where are you setting the parent node value so that you retrieve it on line 107? When I do this in java I'm getting a null pointer exception. How do I get the parent of the searched node?
@VDEngineering
@VDEngineering Год назад
Most likely a syntax issue, you probably did not assign it correctly.
@user-pd9fv2mt5h
@user-pd9fv2mt5h Год назад
H!! Please, can you print all theese code or give me a link, because I get troubles with printing a N-ary tree?
@VDEngineering
@VDEngineering Год назад
check this: leetcode.com/problems/n-ary-tree-preorder-traversal/
@joeabala2037
@joeabala2037 Год назад
@user-pd9fv2mt5h how did you get the parent of the searched node?
Далее
C’est qui le plus fort 😂
00:18
Просмотров 11 млн
А ВЫ УМЕЕТЕ ПЛАВАТЬ?? #shorts
00:21
Просмотров 1,9 млн
Delete a node from Binary Search Tree
18:27
Просмотров 1,1 млн
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
I've been using Redis wrong this whole time...
20:53
Просмотров 354 тыс.
Data structures: Introduction to Trees
15:50
Просмотров 1,4 млн
C’est qui le plus fort 😂
00:18
Просмотров 11 млн