Git Product home page Git Product logo

sorting's Introduction

Sorting and Counting

The following are some exercises in sorting and counting algorithms

Crayonnibalsim

The local kindergarten has a crayonnibal on their hands. Investigators are trying to understand more about the suspect - specifically their crayon preference. The file crayons contains a list of all of the crayons the classroom has. Sort through them, and count the different colors to determine which two colors the suspect most likely prefers to eat.

The Last Question

The Last Question is a famous short story by science fiction writer Isaac Asimov. Indeed, Asimov has been quoted as saying it is one of his personal favorites. The story is about technology, entropy, and the human spirit. The work is now in the public domain.

Use a dictionary to group all of the words in the document by word-length. Hint: The keys of the dictionary should be integers, representing the word length, and the values of the dictionary should be lists of strings. Your lists of strings should contain no repetitions. You may wish to look into Python sets for a nice way to avoid repetition when sorting.

Also note that you will have to do some text-processing to remove punctuation, quotes, etc. Use <str>.lower() to make all of your words lower-case.

sorting's People

Contributors

kelleydv avatar

Watchers

James Cloos avatar Sam Westerman avatar  avatar

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.