Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
asign _1.data,struct
#1
Assignment No. 01
SEMESTER Spring 2011
CS301- Data Structures
Total Marks: 20

Due Date: 19/04/2011
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after due date.
o The submitted code does NOT compile.
o The submitted assignment does NOT open or file corrupt.
o The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
Your Submission must include:

1. A working Make File (Dev-C++ project File).
2. All the Source Code (.h and .cpp files) necessary to compile and run your program.
3. Place all the files in a folder then Zip this folder and Upload it on VU-LMS

Note: Use Dev-C++ IDE.
Objective
The objective of this assignment is

o To give you some practice exercise of linked list Data Structure.


For any query about the assignment, contact at cs301@vu.edu.pk
GOOD LUCK
Marks: 20

The Josephus problem is the following mass suicide "game": n people, numbered 1 to n, are sitting in a circle. Starting at person 1, a handgun is passed. After m passes, the person holding the gun commits suicide, the body is removed, the circle closes ranks, and the game continues with the person who was sitting after the corpse picking up the gun. The last survivor is tried for n - 1 counts of manslaughter. Thus, if m = 0 and n = 5, players are killed in order and player 5 stands trial. If m = 1 and n = 5, the order of death is 2, 4, 1, 5.

Write a C++ program to solve the Josephus problem for general values of m and n using circular linked list data structure.


Input:
 Number of People: n
 Number of Passes: m
Output:
 Order in which people are removed
 The survivor

Sample Run:
Enter total number of People playing the game: 10
Enter number of Passes: 3
----------------------------------------------------
Game Started!
----------------------------------------------------
 Person removed: 4
 Person removed: 8
 Person removed: 2
 Person removed: 7
 Person removed: 3
 Person removed: 10
 Person removed: 9
 Person removed: 1
 Person removed: 6
----------------------------------------------------
 The survivor is : 5
----------------------------------------------------

Lectures Covered: This assignment covers Lecture # 1-5
Deadline: Your assignment must be uploaded/submitted at or before 19/04/2011.
Reply
#2
help plesjhhhhhhhhhhhhhhh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS601 Data Communication Solution and Discussion Due Date: 18/11/2014 education-2014 3 2,297 12-15-2014, 03:05 PM
Last Post: Breaking-news
  CS601 Data Communication Quiz No.2 Discussions and Solutions, Last Date 17-Dec-14 education-2014 0 1,596 12-10-2014, 02:33 PM
Last Post: education-2014
  CS614 Data Warehousing Assignment No. 2 08-12-2014 Vuhelper 1 1,998 12-09-2014, 01:03 AM
Last Post: Vuhelper
  CS301 Data Structures Assignment No. 2 Solution and Discussion Fall 2014 Vuhelper 0 1,702 12-03-2014, 03:20 PM
Last Post: Vuhelper
  CS619 Final Software Project Real Time Financial Data Warehouse SRS Fall 2014 Vuhelper 0 2,169 11-27-2014, 08:39 PM
Last Post: Vuhelper
  CS614 Data Warehousing Assignment No. 1 Solution and Discussion Fall 2014 Vuhelper 2 2,724 11-18-2014, 02:48 PM
Last Post: Vuhelper
  CS301 Data Structures Assignment No. 1 Solution and Discussion Fall 2014 vuassignments 4 3,264 11-18-2014, 02:15 AM
Last Post: Xpert
  CS614 Data Warehousing Assignment No 4 Discussion Spring 2014 Due Date 22 July 2014 vuassignments 1 1,787 07-18-2014, 03:15 PM
Last Post: vuassignments
  CS301 Data Structure Assignments No.4 Solution Fall 2014 Due Date 17th July 2014 Entboy 1 1,796 07-18-2014, 01:32 PM
Last Post: vuassignments
  CS601- Data Communication Assignment No. 3 Solutions and Discussion Spring July 2014 Entboy 0 1,754 07-11-2014, 03:13 PM
Last Post: Entboy

Forum Jump:


Users browsing this thread: 1 Guest(s)