Giter Club home page Giter Club logo

Comments (3)

pllk avatar pllk commented on June 27, 2024

Your implementation is quite similar to this:
https://github.com/Laakeri/contestlib/blob/master/src/string/z.cpp

Still, I'm not sure whether it's a good idea to include an implementation in the book, or should the reader try to understand and implement the algorithm?

from cphb.

yy3721 avatar yy3721 commented on June 27, 2024

That is a good question, and should be up to you as the author. I noticed that some of the chapters in the book do have sample implementations and some don't, so I don't know where the line should be (or is) drawn. I do remember though that back when I was studying I initially struggled with writing Z-algorithm the "long way" (which is taught in quite a few online tutorials) and it made the algorithm seem relatively complex and tricky to implement. Coming up with a concise implementation made the algorithm look much simpler and understandable, and to have less room for errors.

I personally think it would make the chapter "easier" for the reader, but I guess this is more of a philosophical question about the goals of the book - and the question that if we add this implementation, do we need to add one for each chapter.

Feel free to close the issue if you feel like it's up to the reader to come up with the implementation.

As a sidenote, I'd also suggest adding a README.MD this repository at some point in the future with a contribution guide and perhaps notes about your plans and vision for the book. For example a lot of people in the Codeforces thread asked about having tasks related to each chapter, so a readme could be a good place to make those kinds of questions clear.

from cphb.

pllk avatar pllk commented on June 27, 2024

Currently the book contains implementations for some algorithms when there is a short and clever implementation that may be difficult to come up with. Indeed, the short implementation of the Z-algorithm could also be one such implementation.

It is good to keep this issue open and decide later what to do.

from cphb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.