Threaded Binary Tree

Duration: 15 min

This video lesson is available to enrolled students.

Return to /learn/TPSC-ASSISTANT-TECHNICAL-OFFICER/data-structures-and-programming/tree/advanced-k-ary-trees/asset-threaded-binary-tree after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. About Course: About the Course
  2. Paper 2 | Digital Logic: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation, Floating Point Rep
  3. Paper 2 | Computer Organization And Architecture: Basics of COA, Cache Memory Organization, Input Output Organisation, Pipelining, Control Unit Design, Instr Formats & Modes, Programming the Basic Computer
  4. Paper 2 | Analog And Digital Communication: Introduction to Communication Systems & Random Signals, Analog Communication Systems, Information Theory & Digital Communication Fundamentals, Digital Modulation & Detection Techniques, Error Control, Synchronization & Multiple Access Techniques
  5. Paper 2 | Programming in C: C Fundamentals, Control Flow, Functions, Arrays & Pointers, Storage Classes, Structures & Enums, DMA, Macros, Scoping & File Handling
  6. Paper 2 | Data Structures And Programming: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing, Java, OOPS with C++, Java Fundamentals, Array, String, IO & References
  7. Paper 2 | Algorithms: Algorithm Analysis, Sorting Algorithms, Time Complexity Analysis, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos
  8. Paper 2 | Compiler Design: Intro to Compilers, Lexical Analysis, Grammar & CFG, Syntax Analysis: Top-Down, Syntax Analysis: Bottom-Up, Semantic Analysis & SDT, Intermediate Code Gen, Code Optimization, Run Time Environment
  9. Paper 2 | Operating System: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Threads & Process Creation, Deadlock, Memory Management, Virtual Memory, Disc Scheduling, File Management, Unix OS, Linux OS
  10. Paper 2 | Databases: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, Relational Algebra, SQL, Relational Calculus, File Organization & Indexing, Transaction Management, Concurrency Control
  11. Paper 2 | Information Systems and Software Engineering: Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
  12. Paper 2 | Computer Networks: Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware Basics
  13. Paper 2 | Internet & Web Technologies: Website, Browser & Services, Internet Fundamentals, Web Design & Development, Protocols & Services, Web Publishing & Hosting, Server Side & Security, Emerging Technologies, HTML Basics, JavaScript-Basics, CSS, XML, HTML5
  14. Paper 2 | Cyber Security And Emerging Technologies: Emerging Tech Trends
  15. Paper 2 | Cloud Technology: Cloud Computing
  16. Paper 2 | Probability and statistics: Probability, Statistics
  17. Paper-1 English: Vocabulary, Preposition, Articles, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Cloze Test (Cloze Passage), Sentence Construction
  18. Paper 1 General Mental Ability & Logical reasoning: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Percentage, Average, Powers and Exponents (Surds and Indices), Algebra, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Mensuration and Geometry, Mental Ability, Age Problems, Partnership, Arithmetic, Speed Mathematics and Basic Mathematics, Syllogisms, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Seating Arrangements, Blood Relations, Directions (Direction Test), Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Selection Decision Table (Decision Making), Logical Sequence Of Words, Venn Diagram, Analogy
  19. Paper-1 General Knowledge & Current Affairs: State Wise GK, History, Geography, GK- Current Affairs, Static General Knowledge
  20. Full Length Mock Test:
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This lecture introduces threaded binary trees, a data structure that replaces NULL pointers with special links called threads to enable tree traversal without recursion or an auxiliary stack. The instructor defines the concept, distinguishes between single-threaded and double-threaded variants, and demonstrates how left and right pointers are repurposed to point to inorder predecessors or successors. A worked example uses a binary search tree with nodes 1, 2, 3, 5, and 7 (later expanded to a larger tree with values like 10, 8, 30, 4, 9, etc.) to show how NULL pointers are identified and replaced with thread links. The inorder traversal sequence 5, 8, 29, 4, 10, 9, 30, 41, 16, 52 is written on screen to illustrate predecessor and successor relationships. The instructor highlights specific nodes (e.g., 5, 4, 29, 8) and draws arrows to show how traversal proceeds from a node's right child or its inorder successor. The final segment demonstrates the complete inorder traversal of the threaded tree, showing how threads allow sequential access to all nodes without backtracking or stack operations.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The lecture opens with the definition of a Threaded Binary Tree on screen: 'A Threaded Binary Tree is a binary tree in which NULL pointers are replaced with special links (threads) to make traversal easier.' The stated purpose is 'To perform tree traversal without using recursion or stack.' Two types are introduced: Single Threaded Binary Tree (with subtypes Left-Threaded, where the left NULL pointer points to the Inorder Predecessor, and Right-Threaded, described as 'Most Common,' where the right NULL pointer points to the Inorder Successor) and Double Threaded Binary Tree. The instructor begins drawing a node structure with fields labeled 'Left Child Add.', 'Data', and 'Right Child Add.'

  2. 2:00 – 5:00 02:00-05:00

    The instructor draws a binary tree with nodes 1, 2, 3, 5, and 7, then expands individual nodes to show their internal three-field structure. Node 5 is expanded to display 'NULL, Data, 7000' and node 7 shows 'NULL, 7, null,' illustrating how NULL pointers appear in an unthreaded tree. A table format is used to show the left child address, data, and right child address for each node. The instructor then draws a more complete binary tree structure with colored boxes representing node fields and arrows indicating pointer directions, annotating nodes with inorder predecessor and successor threads to demonstrate the double-threaded variant.

  3. 5:00 – 10:00 05:00-10:00

    A larger binary tree is displayed with three-field nodes annotated with specific values: the root shows '100 10 300,' its left child shows '400 8 500,' and the right child shows '600 30 700.' Leaf nodes display values like 'NULL 5 NULL' and '800 4 NULL.' At the bottom, an inorder traversal sequence is written: '5 8 29 4 10 9 30 41 16 52.' The instructor circles the leftmost node (value 5) and draws a horizontal line under it to indicate its NULL pointers. The words 'Predecessor' and 'Successor' are written with arrows pointing to the inorder sequence, establishing that threads will link each node to its adjacent nodes in this traversal order.

  4. 10:00 – 14:50 10:00-14:50

    The instructor demonstrates the threading process by circling specific values in nodes and connecting them to their positions in the inorder sequence. The value 4 is circled with its null right child highlighted, and a line connects it to the inorder sequence. The value 29 is circled in both the tree and the traversal list, as are values 8 and 5. Green brackets are drawn under several nodes to indicate value ranges. In the final segment, arrows are drawn between nodes to represent successor pointers: an arrow from node 41 points to its successor 16, and an arrow from node 52 points to NULL. The inorder traversal sequence is updated step-by-step at the bottom, progressing through '5 8 29 4 10 9 30 41 16 52 NULL,' demonstrating how threads enable sequential traversal without recursion or a stack.

The lecture progresses from definition to demonstration. First, the core concept is established: NULL pointers in a binary tree are replaced with threads that point to inorder predecessors or successors, eliminating the need for recursion or a stack during traversal. Second, the two main variants are distinguished: single-threaded trees (left or right) and double-threaded trees, with the node structure shown as having three fields (left pointer, data, right pointer). Third, a concrete example is built incrementally: starting with a small tree (nodes 1-7), the instructor expands to show internal node structure, then moves to a larger tree with specific pointer values (e.g., '100 10 300' at the root). The inorder traversal sequence is written out to make predecessor-successor relationships explicit. Finally, the threading process is demonstrated by highlighting NULL pointers and drawing arrows to show how each node's thread links it to its inorder neighbor. The key pedagogical move is connecting the abstract definition (NULL replaced by thread) to a concrete visual example where students can trace the traversal path using only the threads, confirming that no stack or recursion is needed. The sequence 5-8-29-4-10-9-30-41-16-52 serves as the reference for all predecessor and successor links throughout the demonstration.

Loading lesson…