نوره 12 @norh_12_1
محررة فضية
الله يوفقها الى تساعدنى فى cs210
هلا بنات انا منى فاهمه شى من هذا السوال مره صعب يليت الى تعرف تساعدنى الله يعافيها او تعالمنى الطريقه لانى متوهقهCS210Spring 2007Programming Project 1Date: Wednesday, March 07, 2007Due: Saturday, March 21, 2007. In the Josephus problem, a group of soldiers is surrounded by the enemy, and one soldier is to be selected to ride for help. The selection is made in the following manner: An integer n and a soldier are selected randomly. The soldiers are arranged in a circle and they count off beginning with the randomly selected soldier. When the count reaches n, that soldier is removed from the circle, and the counting begins again with the next soldier. The process continues until only one soldier remains, who is the unfortunate one selected to ride for help. Work in pairs to:1.Build a complete List class, using a circular linked-list implementation. The circular list is obtained by setting the link of the last node in a standard linear linked list to point to the first nodeFor basic operations it should have a constructor, destructor and a copy constructor, in addition to the basic list operations: empty, display, insert and erase.Assemble the files into CList.h and CList.cpp. 2. Write a program to implement Josephus problem using the List class in part 1 to store the names (or numbers) of the soldiers.________________________________________
3
614
يلزم عليك تسجيل الدخول أولًا لكتابة تعليق.
الصفحة الأخيرة