Halo

A magic place for coding

0%

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 »

Introduction

In the previous posts, I’ve talked about some kinds of abstract data structures, which are some different version of list. In this post, I’ll introduce the List.

Read more »

Introduction

I’ve introduced the Queue structure in previous post. In contiguous storage, queues were significantly harder to manipulate than were stacks, because it was necessary to treat straight-line storage as though it were arranged in a circle, and the extreme cases of full queues and empty queues caused difficulties. As a result, I introduce you the linked queue in this post.

Read more »

Introduction

I’ve introduced the Stack structure in previous post. But considering the efficiency when we operating the entries, you may find that using an array(static one) is not good enough. So in this post, I’ll show you a whole new way to store elements——Linked Structure.

The advantage of linked structure is that it’s convenient to insert or delete element in any position. There won’t be a problem about moving elements. But its setback is also abvious, that is, you can’t randomly access an element unless it is head or back(if possible).

Read more »

Introduction

In the previous post, I’ve talked about Queue. In this post, I’d like to extend it to make it more useful by adding several new methods.

Read more »