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 February 25th, 2018, 05:57 PM
Registered User
 
Join Date: Feb 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default List unflattening: wrong running time

The analysis of unflatteningList() on page 57 is incorrect. Its (worst-case) running time is actually O(n*n). For lists like:

node_1 <--> node_2 <--> ... <--> node_N

where each node points to a single-item child list like: node_1->child = child_1, ... node_N->child = child_N

after flattening the list looks like:

node_1 <--> node_2 <--> ... <--> node_N <--> child_1 <--> ... <--> child_N

And unflatteningList() will examine child_N node N times, child_(N-1) node N-1 times, etc.





Similar Threads
Thread Thread Starter Forum Replies Last Post
List unflattening yamaryl BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 3rd Edition 0 March 16th, 2016 11:45 AM
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
ListView list controls display wrong data the 3rd time muybn ASP.NET 3.5 Professionals 1 August 12th, 2010 06:49 PM
How to display the time(running time) in Excel swaroop Excel VBA 1 March 29th, 2007 01:56 AM
code to make a list, anyone see what is wrong? am6019a VB How-To 3 July 13th, 2006 10:30 AM





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