Category: Strings

0

Evaluation of Infix expressions

Infix notation is commonly used in arithmetic formula or statements, the operators are written in-between their operands. Let’s assume the below Operands are real numbers. Permitted operators: +,-, *, /, ^(exponentiation) Blanks are permitted...

0

Infix, Postfix and Prefix Notations/Expressions

Infix, Postfix and Prefix notations are most common ways of writing expressions. Infix notation: Example: (A+B) Infix notation is commonly used in arithmetic formula or statements, the operators are written in-between their operands. An...

0

Valid Multiple Parentheses

Objective: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. Example: ()()([]({}))[] valid: true ()({]) valid: false []{}() valid: true [(}{)] valid: false Earlier we had seen problem Valid...

0

Valid Brackets – Part 2 | Stack Method

Objective: Given a string containing just the characters ( , ) determine if the input string is valid. Example: ()()(()(()))() valid: true )()()( valid: false ()()) valid: false Approach: Earlier we discussed the solution which keeps...

0

Given two strings validate the output string

Objective: Given two input strings and one output strings, validate if output string contains all the characters from both the input strings. Example: Input1 = “boy”, Input2 = “girl”, output = “gboilry” Result =...

0

Generate all the strings of length n from 0 to k-1.

Objective: Given two numbers, n and k (k>=n), write an algorithm to generate all the strings of length n drawn from 0 – k-1. Example: k = 2, n = 2Output:  0 0      0...

0

Check if two Strings are equal without using built-in function – Java

Objective– Given two strings, find out if they are equal or not without using any built-in function (without using equals() function in java). Example: String x=’tutorial’ and String y=’tutorial’ are equal – true String...

0

Replace all vowels with next consonant in a given string

Objective: Given a string, write an algorithm to replace all the vowels with next consonant, and if last alphabet is vowel, remove it. Example: String input: “abcdefg” Output: “bbcdffg” String input: “aaaabccceee” Output: “bbbbbccc”...

%d bloggers like this: