Jim's
Tutorials

Spring 2018
course
site

Nate's Work

Jim says

This is an improvement over last week, but you are doing only O(n^2) algorithms - not any of the O(n (log n)) ones.

Yes, you pass functions as pointers. But you also need to set up the type signature. Googling "c function pointer" gives for example https://www.geeksforgeeks.org/function-pointer-in-c/ which shows the sort of syntax needed.

I've put together a jupyter python notebook plot, turned that into an .html file so we can see it here easily, and did a screenshot.

$ jupyter notebook jim_plot.ipynb     # edit & run it in a browser
$ jupyter nbconvert jim_plot.ipynb    # create the .html file


In class I showed you demo_function_pointer.c and loop.c , and uploaded both here.

https://cs.marlboro.college /cours /spring2018 /jims_tutorials /web_tech /c_feb28
last modified Sat December 21 2024 6:12 pm

attachments [paper clip]

  last modified size
TXT bubbleSort.c Sat Dec 21 2024 06:12 pm 2.8K
TXT demo_function_pointer.c Sat Dec 21 2024 06:12 pm 495B
TXT insertion.c Sat Dec 21 2024 06:12 pm 2.8K
TXT jim_plot.html Sat Dec 21 2024 06:12 pm 332K
TXT jim_plot.ipynb Sat Dec 21 2024 06:12 pm 77K
TXT jim_plot.png Sat Dec 21 2024 06:12 pm 258K
TXT loop.c Sat Dec 21 2024 06:12 pm 293B
TXT results.csv Sat Dec 21 2024 06:12 pm 551B
TXT selection.c Sat Dec 21 2024 06:12 pm 3.0K