Question
In C++ I need examples of these types of methods which are to be added to an application. 1) searchVal(item:int): bool - method searches a
In C++ I need examples of these types of methods which are to be added to an application.
1) searchVal(item:int): bool - method searches a Linked List for an item. This method returns a true if the value is found in the linked list or false if not.
2) countFrequencyOf(item: int): int - method returns the count of items in the list, returns 0 if none
3) size(): int - method returns the number of items in the list. need to add a counter to your program to increase by 1 as items are added to the list.
4) displayFromFrontToN(n: int) :void - method will display all elements of the list from the head pointer to the nth element or to the end whichever comes first
5) displayFromNToEnd(n : int):void - method will display all elements of the list from the nth element to the end of the list, make sure to check that n is realistic for your list
6) insertInOrder(n : int) : void - method will insert n into the linked list in it's proper order - HINT: this method does require the use of two pointers, you need to keep track of the two nodes to insert between.
7) fillListFromFile( ) : void - method will add elements to the list from this file linkedListData1.txt. This is where you will keep track of the number of elements in the list
8) displayInRows() : void - method displays the linked list in rows of 10 elements - use a counter when you display the values, when the counter reaches 10 output a " " and reset your counter - columns will be a good idea here Demonstrate the above functions in your main() function.
Notes: Not all functions developed in class will be utilized in the final application. Update your delete functions to alter the size attribute of the list.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started