Threaded Binary Tree
Duration: 15 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- About Course: About the Course
- Paper-2 | Programming & Data Structures: C Fundamentals, Control Flow, Functions, Arrays & Pointers, Storage Classes, Structures & Enums, DMA, Macros, Scoping & File Handling, Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- Paper-2 | Databases / DBMS & SQL: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, SQL, Relational Calculus, Transaction Management, Concurrency Control
- Paper-2 | Algorithms: Algorithm Analysis, Time Complexity Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos
- Paper-2 | Computer Networks & Security: 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, Network Access Technologies, Network Security
- 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
- 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
- Paper-2 | Theory of Computation: Introduction to TOC, Deterministic FA (DFA), Non-Deterministic FA, Regular Expressions, Grammar, Regular Language Properties, Moore & Mealy Machines, Pushdown Automata & CFG, Turing Machines
- Paper-2 | Computer Organization & Architecture: Basics of COA, Cache Memory Organization, Input Output Organisation, Pipelining, Instr Formats & Modes, Control Unit Design, Programming the Basic Computer
- 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
- Paper-1 | General Awareness: Polity, Physics, Biology, Chemistry, Static General Knowledge, GK- Current Affairs, History, Geography, Indian Economy, Environment
- Paper-1 | Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Data Interpretation, Blood Relations, Syllogisms, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Clock, Calendar, Cubes & Dices, Directions (Direction Test), Analogy, Seating Arrangements, Analytical Reasoning (Counting Figures Reasoning)
- Paper-1 | Quantitative Aptitude: Ratio and Proportion (Ratios), Mixture and Alligation, Permutation and Combination, Number System, HCF LCM, Speed Time and Distance, Average, Age Problems, Percentage, Profit and Loss, Time and Work, Pipe and Cistern, Simple Interest and Compound Interest, Powers and Exponents (Surds and Indices), Mensuration and Geometry, Probability, Statistics, Arithmetic, Algebra
- Paper-1 | English: Vocabulary, 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), Sentence Construction, Cloze Test (Cloze Passage)
- Coal India Previous Year Paper:
- Engineering Mathematics: Set Theory, Relations, Functions, Graph Theory, Group Theory, Propositional and Predicate Logic, Linear Algebra, Calculus
- Coal India 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
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: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.
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.
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.