This extension provides a collection of useful code snippets for working with common data structures such as binary search, linked lists, and binary trees in C++. Below is a list of available snippets along with their prefixes and descriptions.
Available Snippets
Binary Search
Binary Search Support
Prefix:XbSearch
Description: Snippet for simple Binary Search.
Linked Lists
Linked List Form
Prefix:XLLStruct
Description: Snippet for ListNode definition.
Linked List Insert
Prefix:XLLInsert
Description: Insert a node into a linked list.
Linked List Delete
Prefix:XLLDelete
Description: Delete nodes from a linked list.
Linked List Length
Prefix:XLLLength
Description: Calculate the length of a linked list.
Linked List Search
Prefix:XLLSearch
Description: Search for a value in a linked list.
Linked List Reverse
Prefix:XLLReverse
Description: Reverse a linked list.
Find Middle Node
Prefix:XLLMiddleNode
Description: Find the middle node of a linked list.
Detect Cycle
Prefix:XLLDetectCycle
Description: Detect a cycle in a linked list.
Palindrome Check
Prefix:XLLPalindromeCheck
Description: Check if a linked list is a palindrome.
Sort Linked List
Prefix:XLLSortList
Description: Sort a linked list.
Add Two Numbers
Prefix:XLLAddTwoNumbers
Description: Add two numbers represented by linked lists.
Binary Trees
TreeNode Structure
Prefix:XBTTreeNode
Description: TreeNode structure definition.
Preorder Traversal
Prefix:XBTPreorder
Description: Preorder traversal of a binary tree.
Postorder Traversal
Prefix:XBTPostorder
Description: Postorder traversal of a binary tree.
Construct Tree from Preorder and Inorder
Prefix:XBTPreInBuild
Description: Construct a binary tree from preorder and inorder traversal sequences.
Graphs
BFS of Graph
Prefix:XGBFS
Description: Perform BFS traversal of a graph.
DFS of Graph
Prefix:XGDFS
Description: Perform DFS traversal of a graph.
Binary Search Trees
Search in BST
Prefix:XBSTSearchBST
Description: Search for a value in a Binary Search Tree (BST).
Insert into BST
Prefix:XLLInsertBST
Description: Insert a value into a Binary Search Tree (BST).
Delete from BST
Prefix:XBSTDeleteBST
Description: Delete a value from a Binary Search Tree (BST).
Validate BST
Prefix:XBSTValidateBST
Description: Validate whether a Binary Tree is a Binary Search Tree (BST).