I have to solve this code i am not able to do please help anyone.

Remove alternate elements from array starting from index 0 till only one element is left in the array and display that element.

Design a new number such that 0 is represented by 9, 1 is represented by 8 and so on. for ex: given number- 210. new number to be displayed- 789.

Reverse a linked list in groups of size k

Find the occurences of a digit d in a given range from 0 to n


find kth largest element in array

Remove nth node from end of linked list

Heap Sort.

Find duplicate element in an array.

find whether two strings are anagram or not.

Inversion Count
Last edited on
Give us some code or an explanation of your logic for one of the problems.
Doesn’t have to work entirely, just some.

Edit: and use some code tags around it ([.code][./code]) (just take away the dots and yer good. )
Last edited on
i am not able to code anything. i dont know where to start. i am confused . And i need to submit it tommrow.
Last edited on
Sorry, you probably won't get the job then.
adlice870012 wrote:

i am not able to code anything. i dont know where to start. i am confused . And i need to submit it tommrow.

Of course it would have to be "tomorrow" wouldn't it.

How long have you been sitting on the problems, doing nothing about it?

My guess is you've been "phoning it in" for a few weeks now, and now you're way out of your depth. Your "bluff" that you actually know anything is about to be called.

For us to just spoon-feed you 10 ready made answers for your 10 bullet point assignments won't actually fix anything. You'll still be just as clueless next week, only the questions will be harder.

TBH, you need to own the 'F' you're about to get and drop the course.
Come back next semester with a fresh resolve to actually do the work involved, if you're actually serious about wanting to learn.

Until you shake this "do nothing until the last moment, then try and get others to do your work for you" attitude, you deserve to fail.

I can't begin to relate those 1 liners together. What are you trying to do? It looks like old chef skipped the bottle and went right to the rock, to steal a line from a song.

pick one of the easy ones, and give it a try?
anagram is pretty easy.
what do you get if toupper or tolower both strings, sort them with std::sort, take the substrings that only contain letters, and compare them?
lets see...
George Bush
He bugs Gore!
first line is beegghorsu
second line is beegghorsu
matched!

about 10 lines of code total... give it a try?

and the number one is just a lookup table. for every letter in the number as a string, replace it, turn it back into a number if needed... also a 10 liner. And that is just if there is no way to do it with math, there may be a clever way to do it with a subtract or something. Like, what is 999-210 .. and does that work all the time ?
Last edited on
i am not able to code anything. i dont know where to start. i am confused .

Maybe it is past time for you to give up and forget becoming a programmer. You have neither the ability nor the desire for the work.

i need to submit it tommrow.

All the time wasted, waiting for others to do the work for you, for free.

You won't make the deadline.

Topic archived. No new replies allowed.