Find Jobs
Hire Freelancers

C/C++ code - 04/03/2018 10:31 EST

₹600-1500 INR

Completed
Posted about 6 years ago

₹600-1500 INR

Paid on delivery
linear (non-circular), singly linked list without dummy nodes. It contains integers in non-decreasing sorted order and supports the usual find, insert and delete operations, plus two new operations called undo and redo. A list is considered to be the most recent version after we apply an edit ( insert or delete) operation. The undo operation allows us to change the list back to a previous version, by reversing the last edit operation. We can call undo n times to reverse the last n edit operations. If there is no previous edit operation (because the list is new, or because all edit operations has been undone), undo does nothing. A redo operation cancels the previous undo operation and is used to update the list back to the next more recent version. We can call redo multiple times consecutively to cancel multiple undo operations. To support undo and redo operations in constant time, you need to keep copies of previous versions of the list. Then, undo and redo can just switch between different versions of the list. To reduce memory requirements, you should keep only a finite number of most recent versions. Attempting to undo beyond the oldest version kept will not have any effect on the list. You are to complete following methods using programming language of your choice using the scheme described previously: getHead() : Returns the head of the list. find(int v): Returns true if value v exists in the list, returns false otherwise. insert(int v): Inserts value v into the list, maintaining sorted order. delete(int v): Deletes the first occurrence of value v from the list. If v does not exist in the list, do nothing. undo(): Revert the list back to the previous version by canceling the last edit operation. If no previous version exists (either we have reverted to the oldest version available or the list is new), it has no effect on the list. redo(): Reapply the operation cancelled by the last undo operation. It has no effect on the most recent version of the list. As an example, consider a list L containing 2, 5, and 7, denoted as [2,5,7]. The following shows the sequence of operations executed and the list after each operation. 1. insert(6) // [2,5,6,7] 2. delete(5) // [2,6,7] 3. undo // [2,5,6,7], delete(5) cancelled. 4. undo // [2,5,7], insert(6) cancelled. 5. redo // [2,5,6,7], last undo cancelled, re-apply insert(6). 6. insert(4) // [2,4,5,6,7] 7. redo // [2,4,5,6,7], nothing to redo. 8. delete(3) // [2,4,5,6,7], 3 is not in the list, L remains unchanged. 9. undo // [2,4,5,6,7], delete(3) cancelled. 10. undo // [2,5,6,7], insert(4) cancelled.
Project ID: 16418466

About the project

10 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I have 8+ yrs of experience in C/C++/Datastructures developing large complex telecom products. I can deliver your project as per your requirements using suitable data structures and algorithms, I assure you that I will deliver quality code with covering all test scenarios. I'm good at fixing memory leaks, having knowledge in tools like valgrind and purify. I will charge lowest price as I"m new to freelancer and eagerly wanted to win projects. you can release amount only after you satisfy with my solution. please let me know if you like my proposal.
₹750 INR in 1 day
5.0 (2 reviews)
0.6
0.6
10 freelancers are bidding on average ₹1,260 INR for this job
User Avatar
Hi, I have read the description. I can do this in C/C++ in a few hours. Please contact me if you're interested in working with me.
₹1,500 INR in 1 day
4.9 (107 reviews)
6.3
6.3
User Avatar
Hello my friend, I have experience in C/C++ and data structures Please check my profile and let me know if you are interested.
₹1,250 INR in 1 day
4.8 (27 reviews)
4.5
4.5
User Avatar
I am experienced c/c++ programmer and can perform this activity in a day. Please get back. I can start immediately.
₹1,450 INR in 1 day
5.0 (8 reviews)
3.5
3.5
User Avatar
A proposal has not yet been provided
₹1,250 INR in 1 day
5.0 (1 review)
0.5
0.5
User Avatar
A proposal has not yet been provided
₹1,750 INR in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of INDIA
New Delhi, India
5.0
1
Member since Mar 3, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.