Thursday, September 19, 2019

Algorithmic Design and Data Structure


Implementing Algorithms and Data Structure might seem a bit overwhelming at first however even just understanding the basic meaning it a good place to start. An algorithm can be defined as "a sequence of steps for accomplishing a task"(Lysecky, Vahid, Lysecky, and Givargis, 2016).

Taking this into consideration one of the best places to start would be having a full understanding of what the task is that you are trying to accomplish. By doing this you will then be able to decide what type of algorithm or data structure is needed.

For example, if you are just wanting to capture the names of 20 different people you can use something as simple as a list as the data structure. If you want to be able to find a specific person in that list, then you could use a Search algorithm to do this. And in implementing this search you would first have to apply a sort algorithm since a list must be sorted prior to being searched.

If you are needing to do something more complex that may need to store data within several levels you could implement a Tree type data structure. A good example could be something like automobiles. At the top level you just have cars, going down a level you could then provide Car Manufactures, going down another level makes of cars. Below is an example of this.

Tree_example.JPG

Most people automatically hear the word Algorithm and may shy away however there are many different functions that qualify and do not necessarily need to be over-complex. You may have a list of 100 different random numbers and need to get the median number, you can build a small method/function to perform this calculation, and that is an algorithm. However, most high-level programming languages have many built-in functions within a Class already. In Java many different math functions are already pre-loaded within the Math Class, making more complex problems much easier. 

This is also the case with many other algorithms such as sort, search, max, min, etc. And although building many of these functions/methods can be beneficial in certain circumstances there is no need to re-invent the wheel multiple times if the algorithm you are needed to perform is already built into a Class you can call. 

From my limited experience being able to understand and plan through what the actual problem is you are trying to solve or function you are trying to perform is key and can make the rest of the process much easier.

There is almost a numberless amount of algorithms and data structures someone might encounter and work with however many of them share many similarities and actually come from the same type of data structure. I am sure most of you have heard of at least 1 of the following; JSON, XML, HTML and although each of these might have their own differences they all share a similar data structure so they are not so different either.

The best advice I can give from my experience is just like anything else you learn in life whether it's riding a bike or learning a new spoken language or learning to program. Practice every day even if it is only for several minutes!!

Good luck to everyone on your journey!

Thursday, August 22, 2019

Java and OOP - Intro

Welcome, the first thing to do in getting started with Java is to make sure you have a Java Development Kit installed. 

The latest JDK can be found at the below URL, 

Next, you will want to download and install an IDE (Integrated Development Environment) to work in. I personally prefer IntelliJ however there are many different IDE's available to work with Java including Netbeans which is available here, https://netbeans.apache.org/download/

However, I would suggest trying IntelliJ and see how you like it. I have used this IDE for over a year now and program Python as well as recently Java and JavaScript with it and highly recommend it. Also when installing IntelliJ it installs everything you need including the JDK in order to get started.


Once you have the IDE installed there is a short tutorial in order to get you going on your first small program. https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html#get-started


Object-Oriented Programming

There are many concepts that bring OOP together as a whole. However, in its basic form OOP, consists of the following.

    - Object
    - Class
    - Package

An object is anything that can have characteristics attributed to it, so the object Employee might have the following attributed to it.

  - Name
  - Phone #
  - SSN
  - Address

A Class is a sort of blueprint for objects and facilitates manipulating objects and interacting with other Classes and Objects within them. For example, you might have a class where your main() method is and from there you might create multiple Employee objects from invoking the Employee Class.

A Package is a namespace that contains all related classes and objects allowing them to interact with each other while keeping them separated as well.


Coming from Python where for the most part all of my code is all in the same file and accessible through different functions/methods OOP can be pretty confusing at first. But for large complex programs, it makes complete sense. For in-depth explanations of OOP Concepts please refer to this URL, https://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html