Problem Solving with Algorithms and Data Structures

Few chapter wise pickings from Problem Solving with Algorithms and Data Structures by Brad Miller, David Ranum.

  • Algorithm, a step-by-step list of instructions for solving any instance of the problem that might arise. Algorithms are finite processes that if followed will solve the problem. Algorithms are solutions.
  • Computer science can be thought of as the study of algorithms. However, we must be careful to include the fact that some problems may not have a solution. Although proving this statement is beyond the scope of this text, the fact that some problems cannot be solved is important for those who study computer science. We can fully define computer science, then, by including both types of problems and stating that computer science is the study of solutions to problems as well as the study of problems with no solutions.
  • A Python variable is created when a name is used for the first time on the left-hand side of an assignment statement. Assignment statements provide a way to associate a name with a value.
  • A Python variable is created when a name is used for the first time on the left-hand side of an assignment statement.
  • split will be very useful for processing data. split will take a string and return a list of strings using the split character as a division point. In the example, v is the division point. If no division is specified, the split method looks for whitespace characters such as tab, newline and space.


Although I know the following figures, I feel like adding these to this blog post.plot







  • In some rare cases the contains, get item, and set item operations can degenerate into 𝑂(𝑛) performance
  • Like the robots of Asimov, all recursive algorithms must obey three important laws:
    1. A recursive algorithm must have a base case.
    2. A recursive algorithm must change its state and move toward the base case.
    3. A recursive algorithm must call itself, recursively.
  • Sierpinski Triangle.
  • JSON syntax is based around three simple data types. The first is a Name-Value pair which in a programming language could be realised as an object, record, struct, dictionary, hash table, keyed list, or associative array. A name-value pair looks as follows:
    "first_name" : "Jacob"
    The second type is the JSON Object. A JSON Object is a collection of name-value pairs or Arrays encased in curly brackets.
    { "first_name":"Jacob" , "last_name":"Bellamy" }
    Lastly, we have the JSON Array. A JSON Array roughly corresponds to a list in python. A JSON array is a list of values encased in square brackets. For example:
    {"courses": ["Compsci 101", "Compsci 105", "Compsci 107"]}
  • Python provides us with a very powerful function to use when creating an iterator. The function is called yield. yield is similar to return in that it returns a value to the caller. However, yield also takes the additional step of freezing the state of the function so that the next time the function is called it continues executing from the exact point it left off earlier. Functions that create objects that can be iterated are called generator functions.


One Reply to “Problem Solving with Algorithms and Data Structures”

  1. Hello Tapasweni,
    I see that you are answering lots of programming questions on Quora. I especially liked your answer:

    I am Saurabh, co-founder of Hackr recommends the best online programming courses & tutorials for any programming language. All the tutorials on Hackr are submitted and voted by the programming community. If you find Hackr useful and beneficial, can you please suggest in your answers? You can suggest direct links to the language tutorials as well, for ex: for Python:

    Do let me know if you’ve any feedback/ideas about Hackr. Thanks:)

    Saurabh Hooda


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s