Binary Heap

Posted on Updated on

Heap data structure is widely use in software languages like C, C++, Python, Java etc. There are different type of heaps like Binary Heap, Fibonacci Heap, Binomial Heap and so on. Out of these, Binary Heap is more popular and others are variations of it. Following are the properties of Binary Heap.

  1. Binary tree property: It’s a complete tree i.e All levels are completely filled except last levels which has all keys as left as possible.
  2. Binary Heap is either a Max heap or Min Heap.

Read the rest of this entry »

Print Consecutive Occurrences of Each Character in String Java

Posted on

Problem Statement: Write a program to print consecutive occurrences of each character in a given string.

Test case 1:
Input : affffssdaaag
Output: a1f4s2d1a3g1

Test case 2:
Input: affffssdaaa
Output: a1f4s2d1a3

Test case 3:
Input: aaa
Output: a3 Read the rest of this entry »

Count Occurrences of Character in a String Java

Posted on Updated on

Problem Statement: Write a program to count occurrence of each character in a given string.

Test case 1:
Input : aabacghc
Output: a3b1c2g1h1

Test case 2:
Input: aaabbcccc
Output: a3b2c4 Read the rest of this entry »

Creating Component in Angular 2

Posted on Updated on

Angular 2 being one of the most advanced front-end framework is lead in UI application development framework. Angular 2 is component driven framework, we are supposed to create components to develop the application. In our previous article Angular 2 Hello world example, we discussed how to create Angular 2 application using angular CLI. Here in this article, we will be discussing about steps to create a component in Angular 2 application. Read the rest of this entry »