Java: A Beginner's Guide Sixth Edition Pdf Download

Java: A Beginner's Guide written by Herbert Schildt is at the first position in the list of top 5 best java programming books. This book is written specially for java beginners for easy learning. Herbert Schildt has written another popular java programming book, Java The Complete Reference. I highly recommend you to start learning java from this book. In this article I am sharing the link to download the pdf version of Java: A Beginner's Guide.

Java: A Beginner's Guide Sixth Edition Pdf Download

Table of Contents

Java Fundamentals
Introducing Data Types and Operators
Program Control Statements
Introducing Classes, Objects, and Methods
More Data Types and Operators
A Closer Look at Methods and Classes
Inheritance
Packages and Interfaces
Exception Handling
Using I/O
Multithreaded Programming
Enumerations, Autoboxing, Static Import, and Annotations
Generics
Applets, Events, and Miscellaneous Topics
Introducing Swing
Answers to Self Tests
Using Java's Documentation Comment
Index

Book Name: Java: A Beginner's Guide Sixth Edition
Author: Herbert Schildt
Size: 11.3 MB

- Click Here to Download Java: A Beginner's Guide Pdf -



Top 5 Best Java Programming Books

Which is the best java programming book? This is the first question that comes in our mind when we start learning java programming. So in this article I have made a list of top 5 best java programming books on the basis of their popularity. These books are written for easy learning and are highly recommended for beginners.

List of Top 5 Best Java Programming Books

Java: A Beginner's Guide

Java: A Beginner's Guide

Table of Contents

Java Fundamentals
Introducing Data Types and Operators
Program Control Statements
Introducing Classes, Objects, and Methods
More Data Types and Operators
A Closer Look at Methods and Classes
Inheritance
Packages and Interfaces
Exception Handling
Using I/O
Multithreaded Programming
Enumerations, Autoboxing, Static Import, and Annotations
Generics
Applets, Events, and Miscellaneous Topics
Introducing Swing
Answers to Self Tests
Using Java's Documentation Comment
Index

Head First Java

Head First Java

Table Of Contents

Introduction
Breaking the Surface: a quick dip
A Trip to Objectville: yes there will be Object
Know Your Variables: primitives and references
How Objects Behave: object state affects method &Junior
Extra-Strength Methods: flow control operations, and more
Using the Java Library: so you don't have to write it all yourself
Better Living in Objectville: planning for the future
Serious Polymorphism: exploiting abstract Classes and interfaces
Life and Death of an Object: constructors and memory management
Numbers Matter: math, formatting, wrappers; and statics
Risky Behavior: exception handing'
A Very Graphic Story: intro to GUI, event handling, and inner classes
Work on Your Swing: layout managers to subcomponents
Saving Object: serialization and I/0
Make a Connection: networking sockets and multi-threading
Data Structures: collections and genetics
Release Your Code: packaging and deployment
Distributed Computing: RMI with a dash of serialize, EJE, and Jini
Appendix A: Fatal code kitchen
Appendix B: To 7th Mugs that &diet make it into the rest of the book
Index

Effective Java

Effective Java

Table of Contents

Foreword
Preface
Acknowledgments
Introduction
Creating and Destroying Objects
Methods Common to All Objects
Classes and Interfaces
Generics
Enums and Annotations
Methods
General Programming
Exceptions
Concurrency
Serialization
Appendix: Items Corresponding to First Edition
References
Index

Java - The Complete Reference

Java - The Complete Reference

Table of Contents

Part I: The Java Language
The History and Evolution of Java
An Overview of Java
Data Types, Variables and Arrays
Operators
Control Statements
Introducing Classes
A Closer Look at Methods and Classes
Inheritance
Packages and Interfaces
Exception Handling
Multithreaded Programming
Enumerations, Auto-boxing and Annotations (Meta-data)
I / O, Applets and Other Topics
Generics
Lambda Expressions

Part II: The Java Library
String Handling
Exploring java.lang
Java.util Part 1 - The Collections Framework
Java.util Part 2 - More Utility Classes
Input / Output - Exploring Java.io
Exploring NIO
Networking
The Applet Class
Event Handling
Introducing the AWT - Working with Windows, Graphics and Text
Using AWT Controls, Layout Managers and Menus
Images
The Co-currency Utilities
The Stream API
Regular Expressions and Other Packages

Part III: Introducing GUI Programming with Swing
Introducing Swing
Exploring Swing
Introducing Swing Menus

Part IV: Introducing GUI Programming with JavaFX
Introducing JavaFX GUI Programming
Exploring JavaFX Controls
Introducing JavaFX Menus

Part V: Applying Java
Java Beans
Introducing Servlets

Appendix: Using Java’s Documentation Comments
Index

Programming With Java

Programming With Java

Table of Contents

Chapter 1: Fundamentals of Object-Oriented Programming
Chapter 2: Java Evolution
Chapter 3: Overview of Java Language
Chapter 4: Constants, Variable and Data types
Chapter 5: Operators and Expressions
Chapter 6: Decision Making and Branching
Chapter 7: Decision Making and Looping
Chapter 8: Classes, Objects and Methods
Chapter 9: Arrays, Strings and Vectors
Chapter 10: Interfaces: Multiple Inheritance
Chapter 11: Packages: Putting Classes Together
Chapter 12: Multithreading Programming
Chapter 13: Managing Error and Exceptions
Chapter 14: Applet Programming
Chapter 15: Graphics Programming
Chapter 16: Managing Inputs/Output Files in Java
Chapter 17: Java Collections

Appendices
Appendix A: Java Language Reference
Appendix B: Java Keywords
Appendix C: Difference between Java C/C++
Appendix D: Bit-level Programming
Appendix E: Java API Packages
Appendix F: Java Classes and their Packages
Appendix G: Assertion and Design by Contract
Appendix H: Java Version History
Appendix I: Deprecated Classes and Methods
Appendix J: Statistics of Java Packages
Appendix K: SCJP Exam Model Questions
Appendix L: Points to Remember
Appendix M: Common Coding Errors
Appendix N: Glossary of Java Terms
Appendix O: Projects

Bibliography
Index

Super Keyword in Java

Super refer to parent class. It holds the reference id of parent section of child class object. Observe below example.

class A
{
                int x=10;
}

class B extends A
{
                int x=20;

}

Super Keyword in Java

Here you can see that in child object, two separate sections are created namely parent section and child section. So super actually refer to parent section.

Use of Super Keyword in Java

There are three usage of super keyword in java.
  • Access parent class instance variable.
  • Invoke parent class method.


Below program will show all the three usage of super keyword.

class parent
{
                int x=20;              
                parent()
                {
                                System.out.println("Parent");
                }

                void show()
                {
                                System.out.println("Parent Show");
                }
}

class child extends parent
{
                int x=30;

                child()
                {
                                super();                                //invoke parent constructor
                }

                void show()
                {
                                System.out.println("Child Show");
                }

                void display()
                {
                                System.out.println(x);                   //print child x
                                System.out.println(super.x);      //print parent x

                                show();                                //invoke child show()
                                super.show();   //invoke parent show()
                }

                public static void main(String...s)
                {
                                child c=new child();
                                c.display();
                }
}                  
           
Super Keyword in Java - Output

  • Here both the classes have variable x and method show(). To access variable of child class we simply write x and to access variable of parent class we write super.x.
  • Similarly, to invoke method of child we simple write show() and to invoke method of parent we write super.show(). In this way super is also used to remove the problem of method overriding.
  • super() must be first line of the constructor. In above example we have written super() in first line of child class constructor to call parent class constructor.
  • Super can’t be used in static method.
  • By default super is first line of constructor. Super keyword and this keyword can’t be used together in constructor.

iCloud - How to Backup iPhone Data

Synchronizing data across multiple computers and devices has always posed as a huge challenge for people who need to access their crucial data on round-the-clock basis. Thanks to the iCloud service, Apple product consumers have now got relief from the issues faced during storage and access of data that needs to be shared with others. Gone are the days when entrepreneurs used to install an add-on software and instigate greater employee co-ordination for keeping the data in sync across different gadgets.

iCloud - How to Backup iPhone Data

With iCloud- Apple's best web-based data storage and syncing service, sharing data including calendars, contacts, emails, photos, videos etc. And that's not all, you can even backup all your iPhone data with the help of the iCloud service. This post will tell you how to proceed ahead with the same.

A brief on iCloud Backups 

Companies which are offering iPhone Application Development Service are encouraging their clients to backup all the iPhone data using the very popular iCloud service. With iCloud set up onto your device, you can expect all your iPhone data to automatically backup to your iCloud account available online. However, it is important to know that iCloud doesn't backup all your videos, photos and files and so you'll be required to back up the same using a manual approach that will be discussed rightaway. Do remember that the automatic back up of your iPhone using iCloud takes place only when your phone is plugged in, locked and connected to a smooth Wi-Fi network.

Also Read: An Insight into Apple iMovie app and its New Version 10.0.4

Yet another vital fact about iCloud backups is that with them you can only backup data and settings that are stored on your device. You won't be able to backup data that's already stored in iCloud, including: calendars, contacts, mail messages, bookmarks, shared photo streams, My Photo Stream and all the documents that have been saved into the iCloud account via the useful iOS apps.

What all can be backed up?

Well, Apple's iCloud service allows you to backup the following:
  • Apps
  • Photos in the Camera Roll
  • Videos in the Camera Roll
  • Music that has been purchased through Apple's iTunes service
  • Notes available in the Notes app
  • App data
  • Messages including SMSs, MMSs and iMessage
  • Ringtones
  • Visual Voicemail

What all can't be backed up?

iCloud won't help you if you're keen on backing up the following:
  • Apps, TV shows, music and books that have been removed from the Apple Store, iBookstore and the iTUnes store ever since you downloaded/purchased them
  • Media files that you've synced from your computer

An now, the steps involved in backing up iPhone data using iCloud service

How to Backup iPhone Data

Step 1: Go to your iPhone's Settings-> iCloud-> Storage & Backup
Now, under the 'Backup' tab, turn on the switch for the iCloud Backup.

Step 2: As per the second step, go back to the previous screen and turn on or off all the data that you want backed up from the displayed collection. Talking specifically about the apps, not all the iPhone apps appear here. Only the pre-installed Apple apps appear within this list.

Step 3: Scroll down to the Storage & Backup section and tap on it. Now, choose the “Manage Storage” section to reach a page where you'll be able to view the list of Apple apps and data that have been backed up.

Step 4: If you want to get to the apps, simply go the heading “Backups” followed by selecting and tapping on the device you want to manage. The next page would be the 'Info' page where under the heading 'Backup Options” you'll be able to view the list of top five storage-using apps. Here, you can choose the apps you want to back up. Toggle the apps that you don't want to back up to “Off”. With that you're done with backing up all all your crucial details that are stored within the iPhone. Although Apple gives you 5GB of iCloud storage for free, you may choose to back up more by paying an extra amount starting at $2- on a per year basis.

Wrapping Up

Timely backup of your iOS data to Cloud is essential because if you don't do it for 180 days or more, Apple reserves the right to delete all your previous iCloud backups on an immediate basis. So, get going and follow the aforementioned steps to backup your iPhone data using the easy-to-use and time-tested iCloud service.

About Author
Emily Heming is a savvy writer for Xicom Technologies from where you can opt iPhone Application Developers For Hire and you can also avail the reliable mobile application development services by contacting her.

Java Interview Questions

Here I am providing the most important java interview questions that are frequently asked in interviews. If you want to submit any core java or advance java interview questions or if you find any mistake in below questions than please notify us by the contact us page.


Java Interview Questions (Core Java and Advance Java)

Core Java Interview Questions

Q. Can we keep more than one class in a single java file?
A. Yes

Q. Can we keep main method in each class?
A. Yes

Q. Can we keep more than one main method in a single class?
A. Yes, with different prototype.

class A
{
                public static void main(String...s)
                {
                                System.out.println("Original main method");
                }

                public static void main(int s1)
                {
                                System.out.println("Duplicate main method");
                }
}

Q. Can we call main method explicitly?
A. Yes

class A
{
                public static void main(String...s)
                {
                                System.out.println("The Crazy Programmer");
                }
}

class B
{
                public static void main(String...s)
                {
                                A.main();
                }
}

Q. Can we execute our program without main method?
A. Yes, by using static block (supported till jdk 1.6).

class A
{
                static
                {
                                System.out.println("The Crazy Programmer");
                }
}

Q. Why character takes 2 bytes in java?
A. Because java support UNICODE, and for supporting UNICODE minimum 2 bytes are required.

Q. Is java purely or truly object oriented language?
A. No, because it supports primitive data types.

Q. Does constructor return any value?
A. Yes, it returns current object reference (this).

Q. Constructor is called before or after object creation?
A. It is called at the time of creation of object.

Q. Constructor is static or non-static?
A. 90% constructor is static by nature.

Q. Can constructor overloaded?
A. Yes, constructor is special method and method can be overloaded.

Q. What is the use of default constructor?
A. To initialize the default value.

Q. Inheritance occurs at compile time or run time?
A. At runtime, it can be proved by simply decompiling the .class file of child class.

Q. What super holds?
A. It holds reference id of parent section of child class object.

Q. What is first line of constructor, this or super?
A. By default first line of constructor is super. Both super and this can’t be used together.

Q. Why we use dynamic binding?
A. To achieve abstraction.

Q. Can we keep constructor in abstract class?
A. Yes, each class in java have constructor.

Q. Can we make abstract method static?
A. No, because static is accessed via class name and it will be accessed by anyone.

Q. Why we make interface methods by default public and abstract?
A. Because methods are implemented by end user.

Q. How multiple inheritance is implemented in java?
A. Multiple inheritance is implemented by interface.

interface my1
{
                . . . . .
                . . . . .
}

interface my2
{
                . . . . .
                . . . . .
}

interface my3 extends m1,m2
{
                . . . . .
                . . . . .
}

Q. What is difference between String and StringBuffer?
A. In String object is immutable (can’t be modified) while in StringBuffer object is mutable (can be modified).

Inheritance in Java

  • Creating a new class from existing class is known as inheritance.
  • Inheritance is used to achieve dynamic binding and reusability.
  • The class which is inherited is known as super class or parent class and the class derived from the parent class is known as sub class or child class.
  • Inheritance is implemented using extends keyword. Just take a look on below syntax.

class parent_class_name extends child_class_name
{
                //body
}              

  • All the properties of parent class come to child class if they are not private.
  • An example about how inheritance is implemented in java is given below.

class parent
{
                String name="Mark";
}

class child extends parent
{
                void show()
                {
                                System.out.println(name);
                }

                public static void main(String...s)
                {
                                child c=new child();
                                c.show();
                }

}


  • In above example variable name is default therefore it is accessible in child class. If we make name as private then it will show error like “name has private access in parent”.

Types of Inheritance in Java

  • There are three types of inheritance in java: single, multilevel and hierarchical inheritance.
  • In java, multiple inheritance is not supported by class. Multiple inheritance can be implemented by Interface, later on we will discuss about it.
Types of Inheritance in Java

Why multiple inheritance is not supported in java?

  • In order to decrease the complexity and ambiguity, multiple inheritance is not supported in java.
  • Consider a situation in which we have three classes A, B and C. Class C inherit class A and B. If classes A and B have a method with same prototype and when we call this method in class C then it will cause ambiguity because compiler will be confused that whether method from class A is called or method from class B is called.

C# Local Database - How to Connect and Use Local Database (Sql Server)

A local database is very essential for developing small scale C# applications, because it doesn't requires a server to store the data. So this article is on how to connect and use C# local database.

Well I am pretty sure that most of you would thing, what is a Local Database? A local database is database which can be used locally on a computer, it doesn’t require a server. The advantage of using a local database is you can easily migrate your project from one computer to another (you don’t need to setup/configure a database server). Microsoft provides local database within visual studio which is often called as SQLCE (CE stands for compact edition).

Also Read: How to Create a Keylogger in VB.Net?

So let’s get started!

1. First of all create a new project in C# (make sure you select the Netframe version above 3.5, because local database is supported in Netframe version 4.0 or above).

2. Now right click your project under solution explorer -> select add new item.

3. A new window will be popped up, search for local database and add it.

4. Again a new window will be popped up which ask up to choose a Database Model select Dataset and hit Next & hit Finish.

5. Now we have added a local database in our C# application.

6. Now we need to establish our connection between our local database & C# application.

7. So simply add a button from toolbox and change the text to Start Connection.

8. Double click your form and import the following:
using System.Data.SqlServerCe

Note: If you are facing an error then watch the video tutorial.

9. Double click the button and add the following code:
SqlCeConnection Conn=new SqlCeConnection(//specify the connection string here)

10. In order to find the connection string, go to solution explorer and open app.config file.


C# Local Database - How to Connect and Use Local Database (Sql Server)

11. In the above screenshot you can see the connection string just copy it and paste it here inside the brackets.
SqlCeConnection Conn=new SqlCeConnection(//specify the connection string here)

12. We are almost done now we just need to open the connection so just double click the button and add the following code:
Conn.Open();
MessageBox.Show(“Connection Started”);

That’s it!! Hope you enjoyed the article, please do share it!

Video Tutorial for C# Local Database


How to Get More Followers on Twitter

Being on social media is an important aspect for many businesses and individuals. For businesses, you are able to spread your message to many people quickly and get feedback from them. For individuals, you are able to get news quickly as they happen and interact with your friends on social media.

One of the fastest evolving social media platforms is Twitter. Twitter moves fast, and tweets get forgotten fast as they are replaced by tweets from other users. On twitter, one sees the tweets from people they follow. Your tweets are seen by those who follow you. An important aspect for any person on twitter is getting many followers to see your tweets. Getting retweets is crucial too, since it goes a long way to spread your tweets further, to the followers of your followers.

How to Get More Followers on Twitter

There are several ways of getting followers on twitter, both good and bad. There are methods that will get you inactive followers, others get you followers who do not care about your content, and others may cause you to have followers who are not even in your target segment. There are other focused methods of getting followers too that enable you to get followers who are useful to you and who can help in disseminating information that you post on twitter and on the internet at large.


Having many followers on twitter help you to establish some credibility too. People are likely to believe information from a twitter account with 10,000 followers than an account that has only 200 followers. Large corporations, celebrities and politicians have a large number of followers, while the average individuals have fewer numbers. If you are a celebrity, followers will come by themselves.

To begin with, the methods to avoid are those that lead you to buy followers. There are people on twitter who sell you followers. These are people with several thousand accounts and they can follow you for a certain fee. The problem with such followers is that they are inactive and only serve to inflate your statistics. They add no real value to your twitter account.

Another method to avoid is getting onto programs that promise to give you hundreds of followers in a short time. While they add followers to your account, you get followers from all over the world, and these followers are not necessarily interested in your content but in you following them back.

The proper and useful way to gain followers is that which allows you to target your followers and engage active followers. The first method would be to target people who are tweeting about a specific story or item. For example, if you are a business in the telecommunications industry, you can search for hashtags that are talking about telecommunications and follow those who are active on that specific hashtag. This will lead people to follow you back.

Look at events such as sports and breaking news in the localities you are targeting. Tweet on those hashtags and follow a few people to establish your presence on the hashtag. You are likely to get some retweets and followers.

Another way is to be at an event and tweet information about the event. People will follow you so that they get updates about the event, and they may not be willing to unfollow you fast. This also helps in establishing credibility about you and your account.


Gaining followers is not an overnight thing if you are a small company or an individual. You have to take time and work towards your twitter followers. Being ready to follow a few people first often helps. Be careful however, and only follow people or accounts that add value to your Twitter timeline.

The other method you can use to get more followers on twitter is carrying out promotions and campaigns on Twitter. You can offer rewards to followers and those who tweet or retweet certain messages informing people of your promotion and presence on twitter.

A combination of two or three of these methods should work for you even when you are a small company or an individual. Twitter users tend to want you to follow them first, be ready to do so if you are not a celebrity.

Author Bio:
The author is a freelance writer at essaypro.com where she writes about social media and technology. Her work is known for its accuracy in research and clarity in presenting details.

Programming with Java by E Balagurusamy Pdf Free Download

The various programming books written by E Balagurusmy are in the list of most popular and top selling books in India. In this article I am sharing the link for Programming with Java by E Balagurusamy Pdf Free Download. This book will help you in learning java programming in very easy manner.

Also Read: Object Oriented Programming With C++ 4th Edition By E Balaguruswamy Free eBook Download

TABLE OF CONTENTS
Chapter 1 Fundamentals of Object-Oriented Programming
Chapter 2 JAVA Evolution
Chapter 3 Overview of JAVA Language
Chapter 4 Constants, Variables, and Data Types
Chapter 5 Operators and Expressions
Chapter 6 Decision Making and Branding
Chapter 7 Decision Making and Looping
Chapter 8 Classes, Objects and Methods
Chapter 9 Arrays, Strings and Vectors
Chapter 10 Interfaces: Multiple Inheritance
Chapter 11 Packages: Putting Classes Together
Chapter 12 Multi threaded Programming
Chapter 13 Managing Errors and Exceptions
Chapter 14 Applet Programming
Chapter 15 Graphics Programming
Chapter 16 Managing Input/Output Files in JAVA
Chapter 17 Assertion and Design by Contract
Chapter 18 JAVA Collections
Appendix A : JAVA Language Reference
Appendix B : JAVA Keywords
Appendix C : Differences Between JAVA and C/C++
Appendix D : Bit-Level Programming
Appendix E : JAVA API Packages
Appendix F : JAVA Classes and Their Packages
Appendix G : What's New in Java 1.1 and Java 2
Appendix H : Deprecated Classes and Methods
Appendix I : Statistics of Java Packages
Appendix J : S C J P Exam Model Questions
Appendix K : Points to Remember
Appendix L: Common Coding Errors
Appendix M: Glossary of JAVA Terms
Appendix N: Projects
Bibliography
Index


Programming with Java by E Balagurusamy Pdf Free Download

Book Name: Programming with Java : A Primer 3rd Edition
Author: E Balagurusamy
Size: 16.7MB


- Programming with Java by E Balagurusamy Pdf Free Download -

Huffman Coding Algorithm With Example

Huffman coding algorithm was invented by David Huffman in 1952. It is an algorithm which works with integer length codes. A Huffman tree represents Huffman codes for the character that might appear in a text file. Unlike to ASCII or Unicode, Huffman code uses different number of bits to encode letters. If the number of occurrence of any character is more, we use fewer numbers of bits. Huffman coding is a method for the construction of minimum redundancy codes.


Huffman tree can be achieved by using compression technique. Data compression have lot of advantages such as it minimizes cost, time, bandwidth, storage space for transmitting data from one place to another.

In regular text file each character would take up 1 byte (8 bits) i.e. there are 16 characters (including white spaces and punctuations) which normally take up 16 bytes. In the ASCII code there are 256 characters and this leads to the use of 8 bits to represent each character but in any test file we do not have use all 256 characters. For example, in any English language text, generally the character ‘e’ appears more than the character ‘z’. To achieve compression, we can often use a shorter bit string to represent more frequently occurring characters. We do not have to represent all 256 characters, unless they all appear in the document. The data encoding schemes broadly categorized in two categories.

Fixed Length Encoding Scheme

Fixed length encoding scheme compresses our data by packing it into the minimum number of bits i.e. needed to represent all possible values of our data. The fixed length code can store maximum 224,000 bits data.

Variable Length Encoding Scheme

In variable length encoding scheme we map source symbol to variable number of bits. It allows source to be compressed and decompressed with zero error.

Construction of Huffman Code

A greedy algorithm constructs an optimal prefix code called Huffman code. The algorithm builds the tree T corresponding to the optimal code in a bottom-up manner. It begins with a set of |C| leaves (C is the number of characters) and perform |C| - 1 ‘merging’ operations to create the final tree. In the Huffman algorithm ‘n’ denotes the number of set of characters, z denotes the parent node and x & y are the left & right child of z respectively.


Huffman (C)
1. n=|C|
2. Q=C
3. for i=1 to n-1
4. do
5. z=allocate_Node()
6. x=left[z]=Extract_Min(Q)
7. y=right[z]=Extract_Min(Q)
8. f[z]=f[x]+f[y]
9. Insert(Q,z)
10. return Extract_Min(Q)

Analysis

The Q is initialized as a priority queue with the character C.
Q=C can be performed by using Build_Heap in O(n) time.
For loop takes (|n|-1) times because each heap operation requires O(log n) time.
Hence the total running time of Huffman code on the set of n characters is O(n log n).

Method

The following general procedure is applied for construction a Huffman tree:
Search for the two nodes having the lowest frequency, which are not yet assigned to a parent node.
Couple these nodes together to a new interior node.
Add both the frequencies and assign this value to the new interior node.
The procedure has to be repeated until all nodes are combined together in a root node.

Huffman Coding Example

Construct a Huffman tree by using these nodes.

Value
A
B
C
D
E
F
Frequency
5
25
7
15
4
12

Solution:

Step 1: According to the Huffman coding we arrange all the elements (values) in ascending order of the frequencies.

Value
E
A
C
F
D
B
Frequency
4
5
7
12
15
25

Step 2: Insert first two elements which have smaller frequency.

Huffman Coding Algorithm With Example
Value
C
EA
F
D
B
Frequency
7
9
12
15
25

Step 3: Taking next smaller number and insert it at correct place.

Huffman Coding Algorithm With Example
Value
F
D
CEA
B
Frequency
12
15
16
25

Step 4: Next elements are F and D so we construct another subtree for F and D.
Huffman Coding Algorithm With ExampleHuffman Coding Algorithm With Example
Value
CEA
B
FD
Frequency
16
25
27

Step 5: Taking next value having smaller frequency then add it with CEA and insert it at correct place.

Huffman Coding Algorithm With Example
Value
FD
CEAB
Frequency
27
41

Step 6: We have only two values hence we can combined by adding them.

Huffman Coding Algorithm With Example
Huffman Tree

Value
FDCEAB
Frequency
68

Now the list contains only one element i.e. FDCEAB having frequency 68 and this element (value) becomes the root of the Huffman tree.

If you find anything missing or incorrect in above tutorial then please mention it by commenting below.