Wrox Programmer Forums
|
BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 3rd Edition
This is the forum to discuss the Wrox book Programming Interviews Exposed: Secrets to Landing Your Next Job, 3rd Edition by John Mongan, Noah Kindler, Eric Giguere; ISBN: 978-1-118-26136-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2016, 11:45 AM
Registered User
 
Join Date: Mar 2016
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default List unflattening

There is this old thread in the forum dedicated to the second edition :

List Unflattening

This section of the book apparently is still exactly the same in the third edition. I believe this part should be overhauled in the next edition.

More specifically, I think

- it is worth discussing that there is no algorithm able to unflatten any lists, independently of how those lists were flattened. The unflattening algorithm is specific to the flattening algorithm (at least I believe so)

- at first, it's unclear which flattened list organisation the author attempts to unflatten...

- and finally, it is unclear why the author overlooked the easiest unflattening algorithm :

Code:
void unflatten(Node** head, Node** tail)
{
    if (!(*tail)) return;
    Node* track = *tail;
    while (track)
    {
        if (track->child)
        {
            *tail = track->child->prev;
            track->child->prev = NULL;
            (*tail)->next = NULL;
        }
        track = track->prev;
    }
}

Last edited by yamaryl; March 16th, 2016 at 11:49 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
List Unflattening MattCruikshank BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 2nd Ed ISBN: 978-0-470-12167-2 8 March 14th, 2016 11:45 AM
Dim list As New List(Of Testclass) dotnetDeveloper General .NET 1 January 6th, 2009 08:19 PM
Dim list As New List(Of Testclass) dotnetDeveloper Visual Basic 2008 Essentials 0 January 6th, 2009 04:04 PM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
List tablesname from database & list databasename ittorget MySQL 3 September 10th, 2005 03:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.