ProCodeCG – Private Coding Class – Algorithm & Data Structure – Day #4

Standard

Today we reviewed about data structures in Python, comparing sorting algorithm and then start to learn about searching algorithm.

We started with a simple code to search one element out a list

Screen Shot 2020-07-23 at 10.47.09 Screen Shot 2020-07-23 at 10.55.05

and then find the position

Screen Shot 2020-07-23 at 11.00.25 Screen Shot 2020-07-23 at 11.01.32

then we learned about simple caesar cipher because we want to do frequency analysis to implement our new skill about dictionary and searching

Screen Shot 2020-07-23 at 11.05.57 Screen Shot 2020-07-23 at 11.07.04

Screen Shot 2020-07-23 at 11.10.28

Screen Shot 2020-07-23 at 11.17.32

we started the frequency analysis code with a simple code to count occurrence of an element in a list and also learn how to use a dictionary

Screen Shot 2020-07-23 at 11.19.01 Screen Shot 2020-07-23 at 11.19.33

Screen Shot 2020-07-23 at 11.21.03 Screen Shot 2020-07-23 at 11.25.08

Screen Shot 2020-07-23 at 11.34.12 Screen Shot 2020-07-23 at 11.40.22

and we need to sort it

Screen Shot 2020-07-23 at 11.43.16 Screen Shot 2020-07-23 at 11.44.05

we have found way to count each distinct element of a list with associative array a.k.a dictionary

Screen Shot 2020-07-23 at 11.55.40

this is the homework 😉 we’re going to finish the frequency analysis code next week before we explore more about tree and graphs 🙂

Screen Shot 2020-07-23 at 12.00.37

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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