Class StringInt
Defined in File stringI.h
Nested Relationships
Nested Types
Class Documentation
-
class StringInt
A class to represent a singly linked list of integers.
The StringInt class manages a singly linked list where each node contains an integer value. It provides functions to manipulate and query the list.
Public Functions
-
inline int GetNbEl() const
Get the number of elements in the list.
- Returns:
int The number of elements in the list.
-
inline void GoToBeg()
Set the current element pointer to the first element in the list.
-
inline void GoToNext()
Move the current element pointer to the next element in the list.
-
inline int GetVal() const
Get the value of the current element.
- Returns:
int The value of the current element.
-
inline void SetVal(int val) const
Set the value of the current element.
- Parameters:
val – The new value to set.
-
void Insert(int val)
Insert a new element with the given value at the end of the list.
- Parameters:
val – The value to insert.
-
int FindIndMax()
Find the index of the maximum value in the list.
- Returns:
The index of the maximum value.
-
int FindIndMin()
Find the index of the minimum value in the list.
- Returns:
The index of the minimum value.
-
void DelVal(int indPrune, int newSet)
Delete the value at the specified index and set it to a new value.
- Parameters:
indPrune – The index of the value to delete.
newSet – The new value to set.
-
inline void Del()
Delete all elements in the list.
-
~StringInt() = default
-
StringInt() = default
-
inline int GetNbEl() const