Halo

A magic place for coding

0%

Introduction

 A graph G consists of a set V, whose members are called the vertices of G, together with a set E of pairs of distinct vertices from V. These paris are called the edges of G. If e = (v, w) is an edge with vertices v and w, then v and w are said to lie on e, and e is said to be incident with v and w.

Read more »

Introduction

 The idea of a HashTable is to allow many of the different possible keys that might occur to be mapped to the same location in an array under the action of the index function. Then there will be a possibility that two records will want to be in the same place, but if the number of records that actually occur is small relative to the size of the array, then this possibility will cause little loss of time. Even when most entries in the array are occupied, hash methods can be an effective means of information retrieval.

Read more »

Introduction

 As you know, sequential can keep the keys in order, searching becomes much faster if we use a contiguous list and binary search. Binary trees provide an excellent solution to this problem. By making the entries of an ordered list into the nodes of a binary tree, we shall find that we can search for a target key in O (log n) steps, just as with binary search, and we shall obtain algorithms for inserting and deleting entries also in time O (log n).

Read more »

Introduction

In some old computer languages, pointers or other facilities for dynamic storage allocation are not provided. Lists are often implemented by using an array-based storage. This way to store data sometimes better than the dynamic one. This post will show how to implement linked lists using only integer variables and arrays.

Read more »

Introduction

Linked Lists have great advantages of flexibility over the contiguous representation of data structure, but they have one weakness: They are sequential lists; that is, they are arranged so that it is necessary to move through them only one position at a time. In this post, we can overcome this problem by using trees as data structure, with methods of pointers.

Read more »

Introduction

Before I introduce the String, I’ll talk about the C-strings. Every C-string has type *char **. Hence, a C-string references an address in memory; the referenced address is the first of a contiguous set of bytes that store the characters making up the string. The storage occupied by the string must terminate with the special character ‘\0’. The compiler cannot enforce any of these conventions, but any deviation from the rules is likely to cause a run-time error, which is considered not encapsulated.
Now it is easy for us to use encapsulation to embed C-strings into safer class-based implementation in C++. This makes it more convenient, safe, and significantly efficient.

Read more »

Introduction

In the last post, I’ve introduced the linked list. But there is one problem that we have to traversing the list from its beginning until the expected node was found, which is time-wasting. In this post, I’ll give a new way to solve this problem by using a two links node.

Read more »

Introduction

This post will show you a List implemented by using dynamic storage.
Noted that we use the Node structure the same as which we have used in the previous containers. If you still have question about that, you can search Node in this station.

Read more »