0% found this document useful (0 votes)
163 views12 pages

Accenture Acutal Coding Questions & Psudeo Codes

Uploaded by

rjksanjeev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views12 pages

Accenture Acutal Coding Questions & Psudeo Codes

Uploaded by

rjksanjeev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Accenture Actual Coding Questions & Pseudo Codes

Accenture Actual Coding Questions & Pseudo Codes


Accenture Actual Coding Questions & Pseudo Codes
Q1. Vowel Repetition Problem

Problem Statement
You are given a string str of length n. You have to find and print the most frequent vowel in
the string str
Note: You may assume that str will always have a unique most frequent vowel

Input Format:
The input consists of two lines:
• The first line contains an integer, i.e. n.
• The second line contains a string str of length n. The input will be read from the STDIN by the candidate

Output Format:
Print a single character which represents the most frequent vowel in the given string. The output will be
matched to the candidate's output printed on the STDOUT
Accenture Actual Coding Questions & Pseudo Codes
Example:
Input:
6
xyuaab

Output:
a
Explanation:
As the vowel 'a' occurs the most in the string str, hence 'a' is printed in the output

Sample input
11
abeaicaidao
Accenture Actual Coding Questions & Pseudo Codes
Q2. Add Alternate Nodes in Linked List
Problem Statement
There is a singly linked list represented by the following structure:
struct Node
{
int data;
struct Node* next;
};

Implement the following function:


struct Node* AddAlternateNodes (struct Node* head);

The function accepts a pointer to the start of the linked list, 'head' as its argument. Implement the function to modify the
given list in such a way that original value of each node the value of next to the next node and return the modified list.

Note:
• Return null if list is null. In case of python if list is None return None.
• Do not create new linked list, just modify the input linked list
• 1st and 2nd node values remain unchanged
Accenture Actual Coding Questions & Pseudo Codes
Example:
Input:
head: 1-> 2-> 3-> 4-> 5-> 6-> 7
Output:
1-> 2-> 4-> 6-> 8-> 10 -> 12
Explanation:
Adding original value of the node to its next to next node,
Replace value of '3' with 1+3=4
Replace value of '4' with 2 +4=6
Replace value of '5' with 3+5=8
Replace value of '6' with 4 + 6 = 10
Replace value of '7' with 5+ 7 = 12

Thus obtained linked list is 1-> 2-> 4-> 6 -> 8-10 -> 12
The custom input format for the above case:
7
1234567
(The first line represents the number of nodes, the second line represents the linked list)
Accenture Actual Coding Questions & Pseudo Codes
Sample input
head: 2 -> 1-> 9-> 2

Sample Output
2 - 1 - 11 -> 3

The custom input format for the above case:


4
2192
(The first line represents the number of nodes, the second line represents the linked list)
Instructions:
Accenture Actual Coding Questions & Pseudo Codes

 60
 55
 73
 48
Accenture Actual Coding Questions & Pseudo Codes

 40
 37
 35
 42
Accenture Actual Coding Questions & Pseudo Codes
 52
 63
 33
 43
Accenture Actual Coding Questions & Pseudo Codes

 28
 37
 50
 34
Accenture Actual Coding Questions & Pseudo Codes

 0
 -2
 3
 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy