• Title/Summary/Keyword: the teleporting turtle

Search Result 1, Processing Time 0.013 seconds

Cycle Detection Using Single Edge Node Pruning (단일 간선 노드 전정 사이클 검출)

  • Sang-Un Lee
    • The Journal of the Institute of Internet, Broadcasting and Communication
    • /
    • v.24 no.1
    • /
    • pp.149-154
    • /
    • 2024
  • This paper proposes an algorithm that remedy Floyd's the tortoise and the hare algorithm (THA) shortcomings which is specialized in singly linked list (SLL), so this algorithm fails to detect the cycle in undirected graph, digraph, and tree with multiple inputs or outputs. The proposed algorithm simply pruning the source and sink with only one edge using cycle detection of single edge node pruning. As a result of the experimental of various list, undirected graph, digraph, and tree, the proposed algorithm can be successively detect the cycle all of them. Thus, the proposed algorithm has the simplest and fastest advantage in the field of cycle detection.