<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Computer-Science on Adam Hacks</title><link>https://hackeradam.com/blog/computer-science/</link><description>Recent content in Computer-Science on Adam Hacks</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 28 Feb 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://hackeradam.com/blog/computer-science/index.xml" rel="self" type="application/rss+xml"/><item><title>CS Review: Merge Sort</title><link>https://hackeradam.com/blog/cs-review-merge-sort/</link><pubDate>Sun, 28 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/cs-review-merge-sort/</guid><description>&lt;p&gt;Merge sort is among the divide and conquer algorithms. That is to say, it divides the input array into half, calls itself on both halves. This process is done recursively over the entire array. When we’re done, all the individually sorted pieces are merged back together to form the fully sorted array.&lt;/p&gt;</description></item><item><title>CS Review: Quicksort</title><link>https://hackeradam.com/blog/cs-review-quicksort/</link><pubDate>Sun, 28 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/cs-review-quicksort/</guid><description>&lt;p&gt;Quicksort is another one of the divide and conquer sorting algorithms. It works by partitioning the array around some chosen pivot point, which there are a few different ways to choose.&lt;/p&gt;
&lt;p&gt;Quicksort is generally preferred over &lt;a href="https://hackeradam.com/blog/cs-review-merge-sort/"&gt;merge sort&lt;/a&gt; for sorting arrays due to the fact that the general form of the algorithm sorts in-place.&lt;/p&gt;</description></item><item><title>CS Review: Bubble Sort</title><link>https://hackeradam.com/blog/cs-review-bubble-sort/</link><pubDate>Sat, 27 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/cs-review-bubble-sort/</guid><description>&lt;p&gt;Bubble sort is the easiest possible sorting algorithm you could imagine. It works by simply iterating over an array of data and comparing adjacent items. If those items are in the wrong order, then they are swapped. In doing this, the largest items “bubble up” to the correct position in the array (assuming ascending order, anyway).&lt;/p&gt;
&lt;p&gt;While this is great from a simplicity standpoint, it’s a pretty awful solution in terms of efficiency. The worst-case performance of bubble sort is O(n2). The best-case turns out to be O(n).&lt;/p&gt;
&lt;p&gt;As you can see, this algorithm is not suitable for any sufficiently large datasets.&lt;/p&gt;</description></item><item><title>CS Review: Selection Sort</title><link>https://hackeradam.com/blog/cs-review-selection-sort/</link><pubDate>Sat, 27 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/cs-review-selection-sort/</guid><description>&lt;p&gt;The previous sorting algorithm we took a look at was &lt;a href="https://hackeradam.com/blog/cs-review-bubble-sort/"&gt;bubble sort&lt;/a&gt;. This time around we will be taking a look at selection sort, which is slightly more complex than bubble sort, but only by a tiny bit.&lt;/p&gt;
&lt;p&gt;The idea behind selection sort is that you keep iterating over your array of data, finding the minimum element each time and placing it at the start of the list. In this way, you can think of selection sort as managing two subarrays: the portion of the array that is sorted and the portion that still needs to be sorted.&lt;/p&gt;
&lt;p&gt;Like bubble sort, selection sort has a worst-case time complexity of O(n2), but it does have a tendency to outperform bubble sort. Selection sort also has a nice side-effect where it will never do more than O(n) swaps, which is nice if you’re operating in an environment in which memory writes are costly.&lt;/p&gt;</description></item><item><title>A Review of Binary Search Trees</title><link>https://hackeradam.com/blog/a-review-of-binary-search-trees/</link><pubDate>Fri, 26 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/a-review-of-binary-search-trees/</guid><description>&lt;p&gt;My previous computer science review post took a look at &lt;a href="https://hackeradam.com/blog/a-review-of-binary-trees/"&gt;the tree data structure&lt;/a&gt;. This time around we will be exploring a specific kind of binary tree: The Binary Search Tree.&lt;/p&gt;
&lt;p&gt;Let’s not waste any more time and just jump right in!&lt;/p&gt;</description></item><item><title>A Review of Graphs</title><link>https://hackeradam.com/blog/a-review-of-graphs/</link><pubDate>Fri, 26 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/a-review-of-graphs/</guid><description>&lt;p&gt;You may have noticed that I’ve been putting a lot more work into writing posts for my &lt;a href="https://hackeradam.com/computer-science-review/"&gt;Computer Science Review series&lt;/a&gt; lately. The last installment of this series took a look at &lt;a href="https://hackeradam.com/blog/a-review-of-binary-search-trees/"&gt;binary search trees&lt;/a&gt;. This time around we will be taking some time to review one of my favorite data structures: Graphs.&lt;/p&gt;</description></item><item><title>A Review of Binary Trees</title><link>https://hackeradam.com/blog/a-review-of-binary-trees/</link><pubDate>Thu, 25 Feb 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/a-review-of-binary-trees/</guid><description>&lt;p&gt;In my previous review series, I wrote a &lt;a href="https://hackeradam.com/blog/a-brief-review-of-set-theory/"&gt;brief review of set theory&lt;/a&gt;. This time around we’ll take a look at the binary tree data structure. The tree structure is very common, incredibly useful data structure in the field of computer science and it’s essential that any engineer understand how they work.&lt;/p&gt;</description></item><item><title>A Brief Review of Set Theory</title><link>https://hackeradam.com/blog/a-brief-review-of-set-theory/</link><pubDate>Mon, 11 Jan 2021 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/a-brief-review-of-set-theory/</guid><description>&lt;p&gt;Set theory is the branch of mathematics that, unsurprisingly, deals with sets. It’s an area of great importance in a number of fields, including computer science.&lt;/p&gt;
&lt;p&gt;In this post, I’ll go over a brief review of basic set theory as it pertains to those pursuing an interest in computer science. Let’s just jump right in!&lt;/p&gt;</description></item><item><title>The Dining Philosophers Problem</title><link>https://hackeradam.com/blog/the-dining-philosophers-problem/</link><pubDate>Fri, 21 Aug 2020 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/the-dining-philosophers-problem/</guid><description>&lt;p&gt;The dining philosophers problem is a classic problem in the realm of computer science. If you’ve had any formal CS education you’ve more than likely seen the problem when learning about concurrent programming.&lt;/p&gt;
&lt;p&gt;Today we will take a look at the problem and look at an example of how we can solve it.&lt;/p&gt;</description></item><item><title>Boolean Algebra Cheat Sheet</title><link>https://hackeradam.com/blog/boolean-algebra-cheat-sheet/</link><pubDate>Mon, 20 Apr 2020 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/boolean-algebra-cheat-sheet/</guid><description>&lt;p&gt;I previously posted a &lt;a href="https://hackeradam.com/blog/logic-rules-cheat-sheet/"&gt;logic rules cheat sheet&lt;/a&gt; and figured it was about time that I do the same for boolean algebra.&lt;/p&gt;</description></item><item><title>Logic Rules Cheat Sheet</title><link>https://hackeradam.com/blog/logic-rules-cheat-sheet/</link><pubDate>Sun, 02 Feb 2020 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/logic-rules-cheat-sheet/</guid><description>&lt;p&gt;When working with logic in discrete math appliations there are a plethora of rules you can use for working with the &lt;a href="https://en.wikipedia.org/wiki/Well-formed_formula"&gt;well formed formulas&lt;/a&gt;. Remembering them all can be a daunting task, which is why I like to have a cheat sheet available. As such, here’s a simple one that I like to use when working with these problems.&lt;/p&gt;</description></item><item><title>CS Review - Binary Numbers</title><link>https://hackeradam.com/blog/cs-review-binary-numbers/</link><pubDate>Tue, 19 Sep 2017 00:00:00 +0000</pubDate><guid>https://hackeradam.com/blog/cs-review-binary-numbers/</guid><description>&lt;p&gt;Welcome to what will be the first in an ongoing series aimed at reviewing computer science topics. Today we will be diving into binary number representation. Understanding binary is an important step in gaining a better understanding of how the computer works on a lower level.&lt;/p&gt;
&lt;p&gt;Recall that a computer is made up a whole bunch of integrated circuits, which are in turn made up of a bunch of transistors. These transistors can have one of two states: on or off. We represent these states as a 1 or a 0, respectively. This means that a computer can only work with two different values, 1s and 0s. This is where binary comes in.&lt;/p&gt;</description></item></channel></rss>