Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Imagine an airport check-in queue of size N, where a new
passenger is Enqueued to the check-in queue from rear end and
Dequeued through the front end. However, when the queue has
number of passengers greater than or equal to 80% of N, then
Dequeue operation involves removing passengers from front as
well as rear end. In a special case, when a passenger is a VIP, then
he/she enqueued at front end instead of rear. Implement the above
data structure and operations.

What I have tried:

i am extremely new to C language and am practicing on hackerrank. this is my first assignment in terms of implementation of data structures which i havent really understood it. i am facing problems in how to update size in queue. i hope the community helps.
Posted
Updated 29-Apr-21 10:48am

Forget hackerrank, it is largely a waste of time, and this is not the way to learn a programming language. Get a copy of the c programming language 3rd edition - Google Search[^], and learn the language properly first..
 
Share this answer
 
Quote:
i am extremely new to C language and am practicing on hackerrank

I agree with Richard, do yourself a favor, don't, it is a wrong good idea.
As a beginner, you lack the technical background and experience to understand the reason why algorithms are combined the way they are, so it become magic solution.

Advice: follow properly tutorials, do every exercise.
- Start with tiny/useless projects, the purpose is to learn programming, not doing something useful.
- Start with console mode programs (no fancy graphics, no mouse)
- Learn debugger (an incredible learning tool)
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
- A problem ? Google is your friend.
- Learn one or more analyze methods, E.W. Djikstra/N. Wirth Stepwize Refinement/top-Down method is a good start.
Structured Programming.pdf[^]
https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design[^]
https://en.wikipedia.org/wiki/Structured_programming[^]
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra[^]
https://www.cs.utexas.edu/users/EWD/ewd03xx/EWD316.PDF[^]
Program Development by Stepwise Refinement[^]
- Learn Algorithms and Data-Structures.
GitHub - The-Art-of-Computer-Programming-Books: "Everyday life is like programming, I guess. If you love something you can put beauty into it." ? Donald E. Knuth[^]
Skiena The Algorithm Design Manual
- Learn Boole algebra
- Learn SQL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900