Python Data Types

Python Data Types

Hi there and welcome back. Working late tonight and I’m a quarter through, my coffee that is. Consulting work on the other hand, I’ve got a ways to go. In an earlier post I said I was going to be in “Ruby Land”, well there was an exotic land nearby and I just couldn’t resist – it’s called “Python Land”. “Ruby Land” was a bit more playful, it had jesters, castles, shiny gems and cute (yeah I said cute) little monsters of all sorts. But here in “Python Land” are a bunch of majestic data crunching machines, engineered meticulously for their purpose – perhaps to understand mankind.

Anyway I’ve decided to take on Python along with Ruby because I have this super weird tendency to contrast things, but what I really want to say is that I want to connect them, conceptually. If I had it my way I’d want to connect everything but that wouldn’t leave any room for curiousity and self discovery now would it. Alright moving onto Python…

Continue reading “Python Data Types”

Move Last Node to Front of Linear Linked List

Python - Move Last Node to Front of Linear Linked List

What’s up everyone?!  I hope everyone’s been doing well as always. Today I am going to work on another linear linked list problem.

The prompt is: Write a function to move the last node to the front of a linear linked list. You could do this iteratively or recursively, I’m just going to go with iteratively for this one.

    # move last to front
    def moveLastToFront(self):

        current = self.head
        previous = None
        temp = None

        # empty or single node
        if not current or not

        # traverse the list
        while current is not None and is not None:
            temp = current
            previous = current
            current = = None

        # you could write your own push function here

Of course there are much more efficient ways of writing this. I would say the trick is how to keep track of the last node and the node before last, that way you do not lose the data that you’re trying to move. If you have questions, feel free to post in the comments below!

Linear Linked List – Search Element using Python

Linear Linked List using Python

What’s up friends?!?

Let’s continue on another linear linked list problem. I’m going to make this post short since I’ll use the boilerplate code from the last LLL problem we had. If you need any help, I’ll also post the link to GitHub so you can stroll along.

Anyways, for this problem, I just want to write some code to find a specific element inside the LLL. You could do this iteratively or recursively, whichever way you choose to do, but for the purpose of this program, I am just going to solve it iteratively.

Continue reading “Linear Linked List – Search Element using Python”

Linear Linked List – Insert Element Beginning using Python

Linear Linked List - Insert Element at Beginning using Python

What’s up friends?! Hope your week has been great as always, the weather here has been quite chilly and then hot at different days, so I’ve been taking advantage of it and go hiking quite a bit to clear up my head.

Today, I want to take a moment to introduce data structures. Data structures is one of my favorite topics ever, and in my personal opinion, possibly one of the most important courses of computer science in general, as it provides the foundation for later on. Well, WHAT IS DATA STRUCTURE? Data structure essentially is a way of organizing data for the machine to work efficiently, and you have seen it before, such as array! As such, I want to talk about linear linked list because I am positive colleges would definitely throw these at you, and you definitely are going to spend hours and hours on data structures!

Continue reading “Linear Linked List – Insert Element Beginning using Python”

Bubble Sort Algorithm using Python

Bubble Sort Algorithm Using Python

Hey!!! What’s up everyone?! I hope your week has been great! I have been working on tirelessly on my projects, so I am going to take a short break, and write up this article!

For today, I want to touch base on a classic algorithm that students have seen over the years, and it is called Bubble Sort Algorithm! Now, before I get started, there are obviously much better sorting algorithms are there, but for the sake of improving our critical thinking skills, Bubble Sort Algorithm is a good one!

Continue reading “Bubble Sort Algorithm using Python”

Permutations Using Python

How’s it going everyone?!?

I hope your week has been great and staying healthy. Today I am going to talk about permutations using Python. The version that I am going to use for this program is Python 3.8.3.

Well, what are permutations????? Permutations in mathematics basically are just different combinations of a sequence, and that is exactly what we are going to do. We are going generate a random sequence of integers and find different combos for this sequence!

Continue reading “Permutations Using Python”