Skip to content
Tejsumeru

Thoughts Become Reality

  • Tutorials
  • Video Tutorial
  • Tutorials
  • Video Tutorial
  • Interview Quetions - Java - Tutorials

    Dynamic Array – HackerRank Solution

    December 29, 2020 - By tejsumeru.12@gmail.com

    Query in format 1 x y and 2 x y is given, find the output as given in description using dynamic array concept.

    Continue Reading
  • Interview Quetions - Java - Tutorials

    Anagram Method 3 – HackerRank Solution

    December 29, 2020 - By tejsumeru.12@gmail.com

    Solve Anagram Problem without using Inbuilt method in java. Anagram is a strings that contains same character frequency.

    Continue Reading
  • Interview Quetions - Java

    Write a program for Run Length Encoding

    December 25, 2019 - By tejsumeru.12@gmail.com

    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 strin,strout=""; int count,i,j; System.out.println("Enter String "); strin=sc.nextLine(); i=0; j=0; while(i<strin.length()) { count=1; j=i+1; while(j<strin.length() && strin.toLowerCase().charAt(i)==strin.toLowerCase().charAt(j)) { count++; j++; } strout=strout+count+strin.charAt(i); i=j; } System.out.println("\n\nInPut "+strin); System.out.println("OutPut "+strout); } } Output Enter String AABCCAAA InPut AABCCAAA OutPut 2A1B2C3A Enter String AAAVVVTYUUUIIIII InPut AAAVVVTYUUUIIIII OutPut 3A3V1T1Y3U5I  

    Continue Reading
  • Interview Quetions

    Is there any possibility to create a customized header file with C programming language?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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.

    Continue Reading
  • Interview Quetions

    Is that possible to store 32768 in an int data type variable?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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.

    Continue Reading
  • Interview Quetions

    What are the modifiers available in C programming language?

    December 16, 2019 - By tejsumeru.12@gmail.com

    There are 5 modifiers available in C programming language as follows. Short Long Signed Unsigned long long

    Continue Reading
  • Interview Quetions

    Explain Deep Copy and Shallow Copy with examples?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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> # include <stdlib.h> struct test { char *str; }; int main() { struct test st1, st2; st1.str = (char *)malloc(sizeof(char) * 20); strcpy(st1.str, "GeeksforGeeks"); st2 = st1; st1.str[0] = 'X'; st1.str[1] = 'Y'; /* Since copy was shallow, both strings are same */ printf("st1's str = %s\n", st1.str); printf("st2's str = %s\n", st2.str); return 0; }…

    Continue Reading
  • Interview Quetions

    Difference between ++*p, *p++ and *++p?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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 for assoiativity. Associativity of operators is right to left. Therefore the expression is treated as ++(*p). Therefore the output of first program is “arr[0] = 10, arr[1] = 20, *p = 11“. The expression *p++ is treated as *(p++) as the precedence of postfix ++ is higher than *. Therefore the output of second program is “arr[0] = 10, arr[1]…

    Continue Reading
  • Interview Quetions

    What are stack and heap areas?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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.

    Continue Reading
  • Interview Quetions

    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.?

    December 16, 2019 - By tejsumeru.12@gmail.com

    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 type promotion. So the conclusion is that by type demotion we will not get the correct answer.

    Continue Reading
 Older Posts

Categories

  • Android With Java
  • Android With Kotlin
  • C language
  • C++ Language
  • Data Structure
  • Error Solving
  • Flutter
  • Go Lang
  • Interview Quetions
  • Java
  • Javascript
  • Kotlin
  • Machine Learning
  • MATLAB
  • PHP
  • Python
  • SciPy
  • Tutorials
  • Wordpress
Graceful Theme by Optima Themes