Dynamic Array – HackerRank Solution
Query in format 1 x y and 2 x y is given, find the output as given in description using dynamic array concept.
Query in format 1 x y and 2 x y is given, find the output as given in description using dynamic array concept.
Solve Anagram Problem without using Inbuilt method in java. Anagram is a strings that contains same character frequency.
Run Length Encoding is a form of lossless data compression in which runs of data are stored as a single data value and count, rather than as the original run. import java.util.*; class RLEChallange { public static void main(String args[]) { Scanner sc=new Scanner(System.in); String… Read More »Write a program for Run Length Encoding
It is possible and easy to create a new header file. Create a file with function prototypes that need to use inside the program. Include the file in the ‘#include’ section from its name.
Int data type only capable of storing values between – 32768 to 32767. To store 32768 a modifier needs to use with the int data type. Long Int can use and also if there are no negative values unsigned int is also possible to use.
There are 5 modifiers available in C programming language as follows. Short Long Signed Unsigned long long
In the following C program, struct variable st1 contains pointer to dynamically allocated memory. When we assign st1 to st2, str pointer of st2 also start pointing to same memory location. This kind of copying is called Shallow Copy. # include <stdio.h> # include <string.h> #… Read More »Explain Deep Copy and Shallow Copy with examples?
1) Precedence of prefix ++ and * is same. Associativity of both is right to left. 2) Precedence of postfix ++ is higher than both * and prefix ++. Associativity of postfix ++ is left to right. The expression ++*p has two operators of same precedence, so compiler looks… Read More »Difference between ++*p, *p++ and *++p?
Heap Area:It is used for the objects allocated dynamically (Using malloc() and calloc()). Stack Area:It is used to store local variables and arguments of a method. This stays in memory only till the termination of that particular method.
Let’s take an example to understand it. Suppose double a=1.5; int b=10 and we want to calculate a+b By type demotion, float type a will convert to int. Therefore a=1 and a+b=1+10=11 but we know that correct answer is 11.5 which will only get by… Read More »Why does “type demotion” does not exist instead of “type promotion”? Also, it would consume less space resource than by doing it from type promotion.?