I read Algorithms in Robert Sedgwick's C ++ book. It was mentioned that linked lists can be represented by arrays. Can someone show a simple implementation of linked lists with arrays?
Is it possible to implement the Josephus problem using an implementation of an array of linked lists? If possible, an example implementation will be useful.
Thank!
Instead of a pointer or a link to the next element of the linked list, write the index into an array of the next element. Use an index that cannot be an array index (e.g. -1) to indicate the end of the list.
, , :)
Source: https://habr.com/ru/post/1777065/More articles:Свободный Nhibernate: Самореалистичные многие для многих - nhibernatehow to read task manager list using java program - javaSorting an alphanumeric field in SQL CE (Compact Edition) version 3.5 - sortingHow to implement a scroller in text mode for automatic scrolling? - androidString length limit in F # - error or function? - f #OO programming style - virtual property, constructor parameter or secure setter - designmisunderstanding of the logical operator of c-language - cAccessing local Android file through WebView Javascript - javascriptGlobal_Asax Application_Error Launched, not Default IIS7 Page 404 Page Not Found - c #Sorting a list with spaces inside, jQuery - javascriptAll Articles