Decomposition decomposition (ASP distributed recursive method)

Source: Internet
Author: User
Start input.asp***
<% thenum= request ("num")%>
<style type= "Text/css" >
<!--
. Trees {border-color:black black #666666; padding-left:12px; border-style:solid; border-top-width:0px; border- right-width:0px; border-bottom-width:0px; border-left-width:3px; margin-top:2px; MARGIN-BOTTOM:2PX}
-->
</style>

<div class = "Trees" id= "tree<%=thenum%>" ><%=thenum%><span id= "follow<%=thenum%>" > <iframe name = "agent<%=thenum%>" style= "Display:none" src= "prime_number.asp?num=<%=thenum%>" > </iframe></span></div>
End input.asp***

Start prime_number.asp***
<%
Isprimenumber = False
Thenum = Request ("num")
If Thenum = 2 or thenum = 1 Then
Isprimenumber = False
Else
For i = 2 to Thenum-1
if thenum/i = Int (thenum/i) Then isprimenumber = True:m = I:exit for
Next
End If
If Isprimenumber = False Then%>

<script>
var htmltext = ' <div class = ' trees ' ><%=thenum%>*</div> ';
parent.follow<%=thenum%>.innerhtml = HTMLText;
</script>

<%else%>
<%k = thenum/m%>
<script>
var htmltext = ' <div class = ' trees ' ><%=m%>*</div><div class = ' trees ' id= ' tree<%=k%> ' > <%=k%><span id= "follow<%=k%>" ><iframe name = "agent<%=k%>" style= "Display:none" Prime_number.asp?num=<%=k%> "></iframe></span></div>";
parent.follow<%=thenum%>.innerhtml = HTMLText;
</script>

<%end if%>
End prime_number.asp***

Algorithm application: Distributed multithread Tree Read


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.