Loading...
Searching...
No Matches
#include <array>
#include <cassert>
#include <cstdint>
#include <iostream>
Go to the source code of this file.
static void test () Test implementations.The list_array is the implementation of list represented using array. We can perform basic CRUD operations as well as other operations like sorting etc.
AlgorithmIt implements various method like insert, sort, search etc. efficiently. You can select the operation and methods will do the rest work for you. You can insert element, sort them in order, search efficiently, delete values and print the list.
Definition in file list_array.cpp.
◆ main()Main function.
Definition at line 260 of file list_array.cpp.
260 {
262 return 0;
263}
static void test()
Test implementations.
◆ test()Test implementations.
Definition at line 218 of file list_array.cpp.
218 {
220
221
224 assert(L.top == 2);
230 assert(L.top == 7);
232
233
236 assert(L.top == 5);
238 assert(L.top == 5);
239
240
241 assert(L.search(11) == 0);
242 assert(L.search(12) == 2);
243 assert(L.search(50) == -1);
244
245
247 assert(L.isSorted == true);
249
250
251 assert(L.search(11) == 1);
252 assert(L.search(12) == 2);
253 assert(L.search(50) == -1);
254}
Structure of List with supporting methods.
void show()
Utility function to print array.
void sort()
Sort the list.
void remove(const uint64_t &val)
To remove the element from the list.
void insert(const uint64_t &val)
Insert the new element in the list.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4