Langsung ke konten utama

Postingan

Menampilkan postingan dari Maret, 2020

Binary Tree Introduction

BINARY TREE DATA STRUCTURE               A tree whose elements have at most 2 children is called a binary tree. Since each element in a binary tree can have only 2 children, we typically name them the left and right child. PARTS OF NODE IN BINARY TREE : 1.       Data, 2.       Pointer to left child, and 3.       Pointer to right child. THE USED FROM BINARY TREE ARE FOLLOWING : 1.       Manipulate hierarchical data, 2.       Make information easy to search, 3.       Manipulate sort list of data, 4.       Composting digital images for visual effect, 5.       Router Algorithms, and 6.         Form of a multi-stage decision-making (see business chess). TREE’S PART 1. ...

Introduction To Hash Table & Binary Tree

INTRODUCTION TO HASH TABLE Hashing is the process of mapping large amount of data item to smaller table with the help of hashing function. In  computing , a  hash table  ( hash map ) is a  data structure  that implements an  associative array   abstract data type , a structure that can map  keys  to  values . A hash table uses a  hash function  to compute an  index , also called a  hash code , into an array of  buckets  or  slots , from which the desired value can be found. Advantage using Hash Table :   synchronization. In many situations, hash tables turn out to be more efficient than search trees or any other table lookup structure. For this reason, they are widely used in many kinds of computer software , particularly for associative arrays, database indexing, caches and sets. Disadvantages using Hash Table : Hash collisions are practically unavoidable. when h...

Single Linked List ( Push Head/Tail & Pop Head/Tail)

LINKED LIST Linked List (Senarai Berantai) merupakan koleksi elemen linear data yang urutannya tidak teratur dan letak penempatannya ditentukan dengan alokasi memori. Nah, tempat yang kita pesan dari alokasi memori tersebut dinamakan node . Di dalam Linked List ini, kita diperbolehkan untuk memasukan nilai dan menghilangkan nilai elemen di tempat manapun selama itu masih didalam node yang kita punya. Biasanya Linked List ini digunakan di algoritma untuk menyelesaikan Real-Time Problems, dimana jumlah elemen yang dimasukan tidak terduga. Tapi, terkadang untuk yang sudah mengerti algoritma, akan bertanya-tanya tentang apakah perbedaan antara Linked List sendiri dengan Array ? Berikut adalah penjelesannya. NO Linked List Array 1 Setiap element linked list terdiri dari   bagian, data dan pointer address Setiap element array hanya berisi data saja 2 Pengalokasian ruang memori dilakukan tanpa pendeklarasian ...