根据提供的伪代码,代写segment intersection algorithm这个算法。Segment intersection problemImplement the segment intersection algorithm studied in class (Chapter 2 in the textbook). The input to the algorithm is provided in a text file called input.txt with n lines, where n is the number of segments. Each line consists of four numbers giving the x and y coordinates of the vertices of the segment. For example1 3.5 5 9.45 describes a segment between points p1 = (1, 3.5) and p2 = (5, 9.45) Note that numbers in a line are separated by a single space.Your program should write its results to an output file called output.txt. Each line of the output should start with the coordinates of a detected intersection point, and then the indexes of the segments involved in the intersection follow. For example3.4 5.6 4 7 22 means that segments s4, s7 and s22 intersect at point p = (3.4, 5.6). Note that segment s4 is the segment appearing in the fourth line of input.txt, s7 appears in the seventh line, and so on.Your code should correctly deal with degenerate cases, like vertical or horizontal segments. Refer to the textbook for details.Depending on the language you choose to code your solution, binary search trees may be readily available in a standard library or not. You are welcome and encouraged to use libraries when available. In that case, you can refer to the documentation to discuss the efficiency of the implementation you borrowed.Important InformationYour solution must be electronically submitted to CatCourses Crops.This programming assignment must be solved individually.You can code your solution in Matlab, C/C++, or Java. The choice is up to you. But you have to properly document your submission to explain how your program can be compiled and run. Important: if you solve your assignment in C/C++, it must compile with gcc. Other languages will not be accepted. Do not include solutions depending on the availability of IDEs (e.g., Eclipse or similar). If you use C/C++ or java, please provide instructions to compile your code from the command line.Submissions that do not compile will receive 0 points without further consideration.Your code will be closely inspected to see whether you followed the algorithm presented in class. Solutions not following the algorithm presented in class will receive 0 points.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp
网友评论