Delphi.DeepEqualsTemplate

Here is the template for deep equals of objects through rtti. You can expand it or customize

unit DeepEquals; interface uses classes, rtti; type TObjectHelpers

Читать на сайте автора.

Delphi.Serialization with neon lib

I used neon library, below the example

here is github of my test of this library, lib works nice !!!

how to use? download sources

Читать на сайте автора.

LinkedLists.Reverse

optimal solution

public ListNode Reverse(ListNode head){ var node = head; ListNode prev = null; while(node != null){ var next = node.next; node.next = prev;

Читать на сайте автора.

LinkedLists.FakeNode

To avoid border cases we can create a fake or how it is called sentinel node

public void DoSmth(ListNode head) { ListNode fakeNode = new

Читать на сайте автора.

LinkedLists.DeleteNode

basic approach is to change connection node.next = node.next.next

  1. RemoveElements(ListNode head, int val)

leetcode task

optimal solution through sentinel or fake node

Читать на сайте автора.