Sunday, August 24, 2014

Set Theory with Go Lang - I

Set Theory have huge importance in computer science, in any terms or language (technical language like Java, C#) when it comes to providing efficient and performance oriented solution, one must think of providing data structures which are cost effective and provide best in class performance.

In this series, we will see implementation of Set Data Structure using Go Lang. But first we have to clear some basics of Set Theory in mathematical terms and analogy. Some of the basic definition and understanding with respect to Algebraic Discrete Mathematics.


So let's get started with basic concepts,


  • Set
    • Set means a collection of objects of any sort.
      • Object is broad term. Let's take a look at some example of sets:
        • The Set of all Females in company.
        • A pair of shoes.
        • The set of all ideas contained in a book.
        • A collection of movies.
        • Set have synonyms like 'Collection', 'Class', 'Aggregate'.
    • In generalization we think of a set as a collection of objects which share some common property. However, this restriction is not necessary, as a set containing a dog, a letter 'A', a jacket and Mr. Smith is an acceptable set but it may be uninteresting and not important.
  • Membership
    • A fundamental concept of Set Theory is that of membership or belonging to a set. Any object belonging to a set called a member or an element of that set.  
    • A set is called well defined if it is possible to determine, by means of certain rules, whether any given object is a member of the set.
  • Standards
    • Capital letters with or without subscripts will be used throughout do denote sets, and lowercase letters will be used to denote the elements.  
    • If an element  p belongs to a set A, then we write 

 
                 which is read as "p is an element of set A" or "p belongs to set the set A" or "p is in A".
    • If an element p does not belong to the set A, then we express this fact as
 
                 
                  which is read as "p is not an element of set A" or "p does not belong to set A".
    • There are several ways in which set can be specified. For example, a set consisting of the elements 1,3, and a is generally written as 
               
                  Now if we wish to denote this set as S, then we write as

I look forward to write some basic mathematical models which we will be implementing with Go Lang. I will try to write more about the functions in set theory so readers can understand what functions are there and yes, please comment if there are any suggestions or criticism.

Saturday, August 23, 2014

Welcome to Go Lang with Data Structures!

Hello World,

No, this is not going to be first example of this blog with Go Lang. There are many books available out there for you to show you how to write "Hello World" in Go Lang, even there is one on official website of Go Lang. Go Lang is compiled level language, one of the most promising features of Go is that is get compiled to machine code directly and it's also support cross platform.The language was designed with keeping in mind that features higher level language should be available but not at the cost of performance.

Go was designed for internal use at Google Inc. though later on the project was open sourced and it's one of the best future valuable language to learn for those people who are counting learning new language for getting paid for their programming skills.

This blog will follow Data Structures with Go Lang, with the list of Data Structures will be followed as below:

  1. Set
  2. Multiset
  3. Priority queue
  4. Queue
  5. Dequeue
  6. Stack
  7. String
  8. Tree
  9. Graph

No, Go Lang doesn't have Generics, sorry! As stated by Rob Pike (Googler working on Go Lang), generics are into considerations but not as of now because Generics generally degrade the performance. So, here is my best shot to give for someone who is Googling for Go Lang and Data Structures.

I will also share YouTube videos for Go Lang, if I found some thing interesting. This blog will help you to understand the Go Lang and it's benefits. Once we are done with data structures, we will head for Go Lang and Web Application. That's still a future, so let's get started.