Binary search tree is very efficient and has strengths of array and linked list.Array and Linked List are great data structure but they have some weaknesses.It’s fast to access array but slow to adjust the size.It’s slow to access linked list but fast to adjust the size.However, it’s fast to access binary search tree and it’s still very flexible to adjust the size. What is Binary Tree? Before diving into binary search tree we need to understand binary tree first.Binary tree is an extended form of singly linked list but has two pointers to other nodes (children) instead.Pointers are not READ MORE
Tag: algorithm
Intro to Heap data structure
Heap is one of the most efficient data structure that can handle data for certain purposes.To have a better understanding of heap you can imagine a priority queue. For example, let’s say there are multiple jobs that you need to do for today. They could be chores, work, and any activities.However, not all of them have the same priority and you probably want to finish jobs in order of importance. A priority queue is a queue that takes tasks and handles them in order of specified priority.Therefore, unlike a normal queue which is FIFO – first in first out, a READ MORE