Node* head = NULL; head = insertAtEnd(head, 1); head = insertAtEnd(head, 2); head = insertAtEnd(head, 3); head = insertAtEnd(head, 4); head = insertAtEnd(head, 5); head = insertAtEnd(head, 6); head = insertAtEnd(head, 7); cout
Question 1: package Coding; import java.util.HashMap; public class mostFrequentVowel { public static void main(String[] args) { String str = "amsfiuhjxcnoihawedonvoiljwnwqaaaaaaaaaaaaaaaaaaa"; HashMap map = new HashMap(); for (int i = 0; i
please take more questions like this for practice it will be really helpful for us!!
Questions will be different for every exam(August 2025) so how to prepare for the coding round in just 1 week?
Initialization:
pp = 6
qq = 7
rr = 6
First if condition:
Evaluate (rr & qq):
rr = 6 in binary: 0110
qq = 7 in binary: 0111
0110 & 0111 = 0110 (which is 6 in decimal)
Evaluate 6 < 7 (True)
Since the condition (rr & qq) < qq is true, the body of the if statement is executed:
rr = 8 + pp:
8 + 6 = 14
So, rr = 14
Nested if condition:
Evaluate (qq + 8) & (8 ^ 7):
qq = 7
qq + 8 = 15
8 ^ 7:
8 in binary: 1000
7 in binary: 0111
1000 ^ 0111 = 1111 (which is 15 in decimal)
So, (8 ^ 7) = 15
15 & 15 = 15
Evaluate (qq & pp + rr):
qq = 7
pp = 6
rr = 14
7 & (6 + 14):
6 + 14 = 20
20 in binary: 10100
7 in binary: 00111
00111 & 10100 = 00100 (which is 4 in decimal)
So, the condition (15 > 4) is true.
qq = (qq + rr) + pp:
qq + rr = 7 + 14 = 21
21 + 6 = 27
So, qq = 27
After if statements:
Update qq:
qq = (3 + 5) + qq
3 + 5 = 8
8 + 27 = 35
So, qq = 35
Print statement:
pp = 6
qq = 35
rr = 14
Compute pp + qq + rr:
6 + 35 + 14 = 55
So, the output of the pseudo code is 55.
ChatGpt😂
@@aatifaalam01 yes 🥰
Program 1: (Solving before watching the solution part)
public static char mostFreqVowel(String s) {
//abaa
/*
* step 1 hashmap
* step 2 insert only vowels
* step 3 retrive only vowel with the highest freq
* */
HashMap map = new HashMap(5);
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'a' || s.charAt(i) == 'e' || s.charAt(i) == 'i' || s.charAt(i) == 'o' || s.charAt(i) == 'u') {
map.put(s.charAt(i), map.getOrDefault(s.charAt(i), 0) + 1);
}
}
//map contains a3
char ans = ' ';
int ansint = 0;
for (Map.Entry entry : map.entrySet()) {
if (entry.getValue() > ansint) {
ansint = entry.getValue();
ans = entry.getKey();
}
}
return ans;
}
Sir for Accenture we have to write code in functions then how to write for TCS with or without function
import java.util.HashMap;
class H {
public static void main(String[] args) {
String str="abacaieghg";
char c1;
HashMap map=new HashMap();
for(int i=0;i
sir in pseudocode one answer is 55 explanation : pp=6 rr=14 qq=35 ; pp+rr+qq= 55
explain toh kr
mera 35 hi aya hai ans
LinkedList
#include
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int val) {
data = val;
next = NULL;
}
};
Node* AddAlternateNodes(Node* head) {
if(head == NULL || head->next == NULL || head->next->next == NULL){
return NULL;
}
Node* curr = head->next->next;
Node* prev = head;
while(curr){
curr->data += prev->data;
curr = curr->next;
prev = prev->next;
}
return head;
}
void printList(Node* head) {
Node* temp = head;
while(temp != NULL) {
cout data next;
}
cout next != NULL) {
temp = temp->next;
}
temp->next = newNode;
return head;
}
int main() {
Node* head = NULL;
head = insertAtEnd(head, 1);
head = insertAtEnd(head, 2);
head = insertAtEnd(head, 3);
head = insertAtEnd(head, 4);
head = insertAtEnd(head, 5);
head = insertAtEnd(head, 6);
head = insertAtEnd(head, 7);
cout
bhaii question mei next to next node likha hai toh prev to prev ko kyunn add kar rahe ho??
2nd question of linked lists..
PLEASE PROVIDE THE JAVA PDF ,
THE LINK IS NOT AVAILABLE.
Pls send these solutions in C and python
Question 1:
package Coding;
import java.util.HashMap;
public class mostFrequentVowel {
public static void main(String[] args) {
String str = "amsfiuhjxcnoihawedonvoiljwnwqaaaaaaaaaaaaaaaaaaa";
HashMap map = new HashMap();
for (int i = 0; i
Why didn't you give a practical approach in the python language
Pseudo code
I got ans
55,37 and 0
pp=6 rr=14 qq=35 ; pp+rr+qq= 55
@@mahaboob0007 yaa
i got 35 correct ans
where can i get the python code
sir how to join the live sessions
How i download a programs
Pls send the code in c also
Python pdf
I have a doubt in question no. 5 at 1:17:52 can anyone explain the line for( each r from 3 to 5)
#include
using namespace std;
int main() {
int p, q, r;
p = 4;
q = 6;
r = 8;
r = (10 + 3) + p; // r = 13 + 4 = 17
for (int i = 3; i
Plse upload python pdf
Bhai code likh aur execute kar k dikhana ase kuch bhi ni