Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Jaiwant R.
Undergrad Student
Tutor Satisfaction Guarantee
Computer Science (General)
TutorMe
Question:

1. Name the components of CPU? 2. What is the use of registers in CPU? 3. What is the function of MAR? 4. What is the function of MDR / MBR? 5. What is program counter? 6. What is the function of IR? 7. What is the purpose of Instruction Decoder?

Jaiwant R.
Answer:

Ans1)) a) ALU b) PC c) Accumulator d) MAR e) IR f) ID g) MDR Ans2)) It is used to store intermediate data and instructions. Ans3)). It specifies the address of memory location from which data or instruction is to be accessed or to which the data is to be stored. Ans4) .It contains the data to be written into or read from memory location addressed by MAR. Ans5). It keeps track of the memory address of the instruction that is to be executed next. Ans6). It contains the instruction that is being executed. Ans7). It decodes the instructions.

C++ Programming
TutorMe
Question:

Given a string S of length N how many substrings of the string S are also substrings of the string "....xyzabcdefghijklmnopqrstuvwxyzabc...".

Jaiwant R.
Answer:

#include <stdio.h> typedef long long ll; const int MAX = 1e5 + 10; int test, n, cnt; char s[MAX]; ll res; bool check(const char& a, const char& b){ if (a == 'z' && b == 'a') return true; return a + 1 == b; } int main(){ scanf("%d", &test); while (test--){ scanf("%d %s", &n, s + 1); res = 0; cnt = 1; for (int i = 2; i <= n + 1; ++i) if (i == n + 1 || !check(s[i - 1], s[i])){ res += ((ll)cnt * (cnt + 1)) >> 1; cnt = 1; } else ++cnt; printf("%lld\n", res); } return 0; }

C Programming
TutorMe
Question:

Write a c program where given n distinct integers and from them you need to find the number of triplets whose sum is less than S.

Jaiwant R.
Answer:

#include<stdio.h> #include<math.h> int main(void) { int n,i,e,r,u,A[10000]; scanf("%d",&n); while(n--) { scanf("%d",&u); for(i=0;i<u;i++) { scanf("%d",&A[i]); } scanf("%d",&r); e=match(A,u,r); printf("%d\n",e); }return 0; } int match(int a[], int size, int sum) { int t=0,i,j,k; for ( i = 0; i < size-2; i++) { for ( j = i+1; j < size-1; j++) { for ( k = j+1; k < size; k++) { if (a[i] + a[j] + a[k] <sum) { t++; } } } }return t;}

Send a message explaining your
needs and Jaiwant will reply soon.
Contact Jaiwant
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.