Tamamlanmış

Josephus Project

Build a Circular Linked List with the provided code to represent the circle of

people and simulate the problem. Your program should use two parameters, n

people and k, where k is the number of counts. In other words, we successively

remove the kth person from the list.

To complete the task, you need to fill in the missing code. I’ve included code

to create an Iterator.

1

An Iterator is an object that iterates over another object – in this case, a

circular linked list. You can use the .next() method to advance the Iterator

to the next item (the first time you call it, the iterator will travel to node at

index 0). Using iterator’s .remove() removes the node the iterator is currently

at.

Say that we had a CircularLinkedList that looked like this:

A ==> B ==> C ==> D ==> E ==>

Calling .next() three times will advance the iterator to index 2. Calling

.remove() once will remove the node at index 2.

A ==> B ==> D ==> E ==>

Calling .remove() once more will remove the node now at index 2.

A ==> B ==> E ==>

The Iterator methods handle wrapping around the CircularLinkedList.

Be sure to create the iterator using [login to view URL]() and after you’ve

added all the nodes to the list, where l is your CircularLinkedList.

Here are examples of rings with n people and every kth person is removed from

the ring.

For a ring of n = 5 and the count k = 2:1

1 ==> 2 ==> 3 ==> 4 ==> 5 ==>

1 ==> 3 ==> 4 ==> 5 ==>

1 ==> 3 ==> 5 ==>

3 ==> 5 ==>

3

For a ring of n = 13 and k = 2

1 ==> 2 ==> 3 ==> 4 ==> 5 ==> 6 ==> 7 ==> 8 ==> 9 ==> 10 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 4 ==> 5 ==> 6 ==> 7 ==> 8 ==> 9 ==> 10 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 5 ==> 6 ==> 7 ==> 8 ==> 9 ==> 10 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 5 ==> 7 ==> 8 ==> 9 ==> 10 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 5 ==> 7 ==> 9 ==> 10 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 5 ==> 7 ==> 9 ==> 11 ==> 12 ==> 13 ==>

1 ==> 3 ==> 5 ==> 7 ==> 9 ==> 11 ==> 13 ==>

3 ==> 5 ==> 7 ==> 9 ==> 11 ==> 13 ==>

3 ==> 7 ==> 9 ==> 11 ==> 13 ==>

3 ==> 7 ==> 11 ==> 13 ==>

3 ==> 7 ==> 11 ==>

3 ==> 11 ==>

11

We are starting with 1 as opposed to 0

Beceriler: Java

Daha fazlasını gör: free bbq project build, project build, patio sunshade project build, josephus war, josephus commentary, convert project build file ant build, car shoroom sample project build vb net, customer support project build jspservletshtml, face recognition project build net, freelance project build bookstore website, project build est , project build hpgl plotter, project build warehouse, project build website based supplied template text, project build website real estate company, real estate project build buildings, sample project build weblogic linux, firefox extension project build, project build error non resolvable parent pom, newbie project build a simple wordpress website

İşveren Hakkında:
( 3 değerlendirme ) philadelphia, United States

Proje NO: #17861351

Seçilen:

cma93

Hi, I'm an experienced programmer. I'm interested in your task and would like to do it. I'm available so contact me anytime.......... Thanks.

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(2 Değerlendirme)
1.8

Bu iş için 3 freelancer ortalamada $40 teklif veriyor

koustav2006

HI..I am good and experienced in data structures programming in java object oriented programming and can help you complete circular linked list to solve the given problem.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(107 Değerlendirme)
5.7
khangcnttit92

hi nice to meet you with more than 8 year in java so I can do it for you as best . please contact me at here . thanks you in me

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(104 Değerlendirme)
5.8