Showing posts with label Algorithms. Show all posts
Showing posts with label Algorithms. Show all posts

22 December, 2014

Standard Template Library (STL): An Introduction Part 3

In the previous post STL : An introduction Part 2 

Containers and their types and gave a little brush upon vectors too. This post is a continuation of the previous post and if you have not read it, I highly recommend you to take a look at it.

In this post I will be walking you through 
  • Iterators : types and some examples.
  • Algorithm : some basic algorithms like sort(), insert() using vector object.
  • Functors( function objects) : an introduction
  • String class : 
So lets get started with iterators, shall we!

17 December, 2014

Standard Template Library (STL): An Introduction Part 2

In previous post, STL Part 1.

I have written about the standard libraries in C++ and how some of them are inherited from our beloved C programming language.

In this post I will be walking you through 
  • Containers : types and some examples.
    • Sequence Containers
    • Associative Containers
    • Container Adapter Classes
  • vector STL Template Class

14 December, 2014

Standard Template Library (STL): An Introduction Part 1

C++

Quite a fascinating language isn't it? But people will swear to it that their lives(especially developers) have been made a lot easier with the use of Libraries.

Today I will be talking about
  • C  Libraries  and  Headers
  • C++ Standard Libraries
    • C++  Libraries  and  Headers
    • C++  Standard  Template  Libraries  and  Headers
  • Boost  C++  Libraries

27 November, 2014

Huffman coding: Tutorial

Lets say you have a set of characters and their frequency of use and you want to create a huffman encoding for them:
  FREQUENCY        VALUE 
  ---------       -----
     A            0.35
     B            0.1
     C            0.2
     D            0.2
     E            0.15

Creating a huffman tree is simple.


Step 1 : 

Sort this list by frequency.