Jai
BAN USER- 4of 4 votes
AnswersWrite code/ logic to count number of words in a string delimited by " ". Anything apart form " " are ignore for the counting. String could be very big as big as 5 GB of data. So add logic to handle such large strings..
- Jai in United States
ex: aaa b c ddd e = Count (5)
aaaaaaaaaaa = Count(1)
a
b
c
d
Count(1) as there are no spaces rather carriage returns are found.
PS: In case above question is not clear do let me know.| Report Duplicate | Flag | PURGE
SDE-2 Arrays
Start from a given node and traverse the linked list. Validate for null or start node point condition while traversing the linkedlist . In case we find node->next = null at any time then LL is not circular in nature. In case we encounter starting node address again then it means it is circular LL.
Thanks,
Please remember O.Cust_id is foreign key in Orders table and foreign key can be nulls too. In this relation with left outer join it we are not checking null primary keys of customer table rather we are checking in customers who don't have records in orders table which is fine so will return null values..
- Jai December 19, 2014Here is psedocode mixed with code as solution.
Create new string that holds the reverse of given string and append the input string to it..
char [] newString = new char[s.length + (s.length - 1)]
char [] currentString = 'You'
for (int i=0; i< currentString.length; i++)
{
newstring[i] = currentString [currentString.length -i]
}
for (int i=currentString.length+1; i< newString.length ; i++)
{
newstring[i] = currentString [i]
}
Console.WriteLine((string) newstring) ;
Here is an untested code, I have combined psedocode and some code to convey the logic..
At a high level try to take out the busy schedule from available dates. That will give you free dates. Once we have common freedates get the interval logic implemented.
struct timeInterval
{
int upperlimit;
int lowerlimit;
}
ArrayList PersonTimeIntervales [] = timeInterval
{
{1,5},
{10, 14},
{19,20},
{21,24},
{27,30}
}
ArrayList PersonTimeIntervales2 [] = timeInterval
{
(3,5),
(12,15),
(18, 21),
(23, 24)
}
int []calendarDate = new int[30]
calendarDate = {1,2, to 30}
Take out the busy dates from common calendarDate array
foreach(TimeInterval T in PersonTimeIntervales)
{
foreach(i=t.lowerbound; i<=t.upperbound; i++)
{
calendarDate [i] = 0;
}
}
foreach(TimeInterval T in PersonTimeIntervales1)
{
foreach(i=t.lowerbound; i<=t.upperbound; i++)
{
// we can add check if need to see if the date is already set to 0
calendarDate [i] = 0;
}
}
calendarDate []: 0 0 0 0 0 6 7 8 9 0 0 0 0 0 0 0 16 17 0 0 0 0 0 0 0 0 25 26 0 0 0 0
tempUpperB = 0 ;
templowerB = 0 ;
for(int i = 1; i<=30; i++)
{
if (calendarDate [i] > 0)
{
if (templowerB = 0 )
{
templowerB = calendarDate [i] ;
}
tempUpperB = calendarDate [i] ;
continue;
}
if (calenderDate[i] = 0)
{
if (tempUpperB > 0 )
{
freeTime[counter++] = TimeInterval{templowerB, tempUpperB ) ;
tempUpperB = 0
}
else
{
templowerB = 0
}
}
}
RepTashaGarlo, Blockchain Developer at ASAPInfosystemsPvtLtd
I’m Tasha , working as a press reporter in the USA. I collect, write, or distribute news or other current ...
RepAndreTmily, Area Sales Manager at Axiom Sources
A purchasing manager, also known as a purchasing director or supply manager, responsible for procuring goods and services for resale ...
RepGrimesOtto, Java Developer at Coupondesh
I am Grimes Agriculture inspector. I examine agriculture commodities and related operations . I like listening to music, painting, and reading ...
Repguthg713, Area Sales Manager at Broadsoft
I am News camera operator photojournalist who records video of news interest for television and online media outlets. I have ...
RepValerieHill, abc at 8x8
I am a highly motivated development and community advocate with over 2 years experience fostering strong community relations product advancements ...
Repgeraldbelz, Applications Developer at ABC TECH SUPPORT
My background is in Mechanical Engineering with a specialization in Control Systems. My passion is centered in Machine Learning , Service ...
RepPeterRox, Java Developer at Cleartrip.com
I am Peter, a punctual, problem-solving, and communicative individual who possesses administration, finance, sales, computer skills and experience. I enjoy ...
RepTracieHoutz, Animator at ADP
I am Tracie , currently the Associate Art Director at Curtie , where I have an excellent reputation for my strong conceptual ...
RepDeevaAllen, Android Engineer at Absolute Softech Ltd
I am Deeva, currently a Credit Card Authorizer , where I assess authorization requests for credit limit increases, and handle lost ...
Here is another approach to find the Nth highest occurrence..
- Jai June 30, 2017