Non-Recursive Hierarchical Data Traversal via User-Allocated Stack

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional recursive algorithms for traversing hierarchical data structures, such as file systems, incur significant computational and memory overhead, leading to potential program crashes and performance issues when dealing with deep directory structures due to excessive call stack usage.

Innovation Solution

Implementing a non-recursive traversal method that uses a user-allocated data structure, like a stack or heap, to keep track of branch points instead of relying on the call stack, thereby eliminating the need for recursive function calls and reducing memory overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If recursive function calls are used to traverse hierarchical data structures, then the traversal logic is simple and elegant, but computational overhead and memory usage increase significantly

Engineering Contradiction:
Improvetraversal logic simplicityVSAvoidcomputational overhead
Core Design Contradiction:
Ease of operationVSUse of energy by moving object

Solution Approach 1:

The patent introduces an intermediary data structure (stack or heap) to replace the call stack used in recursive algorithms. This intermediary structure manages the traversal state explicitly, eliminating the need for nested function calls while maintaining the same traversal logic. The intermediary acts as a buffer between the traversal algorithm and the hierarchical data structure, resolving the contradiction by providing iterative control flow with reduced computational overhead.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If recursive function calls are used to traverse deep directory structures, then complete traversal is achieved, but call stack exhaustion occurs causing program crashes

Engineering Contradiction:
Improvetraversal completenessVSAvoidcall stack exhaustion
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

Solution Approach 1:

The patent extracts the call stack dependency from the traversal algorithm by implementing an explicit stack or heap data structure. This extraction removes the harmful factor of call stack exhaustion while preserving the traversal completeness. The explicit data structure is allocated in a different memory region that does not have the same stack size limitations, thereby eliminating the risk of program crashes due to deep directory structures.

Inventive Principle:
Principle #2Taking out (Extraction)

3Ease of manufacture

If recursive algorithms are used for hierarchical data traversal, then the implementation is straightforward, but application performance deteriorates

Engineering Contradiction:
Improveimplementation straightforwardnessVSAvoidapplication performance
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent transforms the static recursive call structure into a dynamic iterative process with explicit state management. The traversal algorithm dynamically adjusts its execution flow by pushing and popping states in the explicit stack/heap, allowing for better performance optimization while maintaining implementation simplicity. This dynamic approach enables the algorithm to avoid the overhead of repeated function call setup and teardown that plagues recursive implementations.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS7606815B1Non-recursive processing of hierarchical data
Publication Date: 2009.10.20 EMC IP HLDG CO LLC
  • US7606815B1 patent drawing
  • US7606815B1 patent drawing
  • US7606815B1 patent drawing

AI summary

Non-recursive traversal of hierarchical data structures is disclosed. Elements inside a hierarchical data structure are processed beginning at a first level of the hierarchical data structure. In the event that a branch point associated with a second level of the hierarchical data structure is encountered, a marker data associated with a location of the branch point within the hierarchical data structure is stored inside a user allocated data structure, and the marker stored in the user allocated data structure is used to enable elements, if any, in the second level and any remaining elements in the first level, if any, to be processed without recursion.